Uncaught Error: an unsupported module was defined, expected `define(id, deps, module)` instead got: `1` arguments to define`

These error comes up when i run ember serve.

Uncaught Error: an unsupported module was defined, expected define(id, deps, module) instead got: 1 arguments to define`

loader.js:247 Uncaught Error: Could not find module ember-resolver imported from `disaworksui/app

Please suggest me the fix of this error.

Versions: “ember-cli”: “^3.20.2”,

Do you have any more context you can provide about the error? Is this a brand new app or an existing one? Were any changes recently made (code changes, new packages installed, etc)? Have you tried removing node_modules and reinstalling all the packages? What version of node are you running?

Yes, dan. I am working on an existing app of ember version 2.3. and I have to upgrade it to the LTS 3.20 version. So I have upgraded the node version, ember-cli, & node packages to their latest version and installed them.

ember-cli: 3.20.2 node: 14.15.3

I have fixed the build errors which came upon running ember serve. This error comes when I try to open the landing page of the application i.e., localhost:4200

My ember-cli-build.js

app.import(‘bower_components/bootstrap-sass/assets/javascripts/bootstrap.min.js’);

app.import(‘bower_components/jquery-ui/themes/smoothness/jquery-ui.min.css’);

app.import(‘bower_components/jquery-ui/ui/minified/core.min.js’);

app.import(‘bower_components/jquery-ui/ui/minified/widget.min.js’);

app.import(‘bower_components/jquery-ui/ui/minified/mouse.min.js’);

app.import(‘bower_components/jquery-ui/ui/minified/sortable.min.js’);

app.import(‘bower_components/jquery-ui/ui/minified/datepicker.min.js’);

app.import(‘bower_components/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.css’);

app.import(‘bower_components/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.js’);

app.import(‘bower_components/jquery-validation/dist/jquery.validate.min.js’);

app.import(‘bower_components/jquery-mask-plugin/dist/jquery.mask.min.js’);

app.import(‘bower_components/jquery-ui/ui/menu.js’);

app.import(‘bower_components/jquery-ui/ui/autocomplete.js’);

app.import(‘bower_components/jquery-ui/ui/position.js’);

app.import(‘bower_components/file-saver/FileSaver.js’);

app.import(‘bower_components/lodash/lodash.js’);

app.import(‘vendor/tabindex.js’, {

type: 'vendor'

});

app.import(‘bower_components/ember/ember-template-compiler.js’);

app.import(‘bower_components/bootstrap-timepicker/js/bootstrap-timepicker.js’);

app.import(‘vendor/tabindex.js’, { type: ‘vendor’ });

app.import(‘bower_components/jquery-validation/dist/additional-methods.min.js’);

app.import(‘vendor/oidc-client.min.js’, {

type: 'vendor'

});

app.import(‘vendor/js-cookies.js’, { type: ‘vendor’ });

How to migrate these bower dependencies to NPM?

Did you just upgrade the packages or did you use ember-cli-update? That is a HUGE version jump and there were a lot of blueprint changes along the way so if you missed any of those it can cause big problems. Possibly like the one you’re seeing now. If you haven’t already I would try to run ember-cli-update. Usually I recommend updating by LTS versions (so only jumping 4 at a time). When 3.0 landed it removed a lot of deprecations so if you didn’t work through all the 2.x deprecation warnings there’s a lot of API surface area that was just removed and may also cause you issues.

How to migrate these bower dependencies to NPM?

As for migrating bower to npm… in my experience pretty much any package should have been ported to an npm package so you just need to find an equivalent package/version, move the dependency from bower file to package.json, and then change the import path in ember-cli-build… e.g.

  app.import('node_modules/jquery-ui/ui/slider.js');
  app.import('node_modules/jquery-ui/ui/sortable.js');