question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: emberAutoImportDynamic is not defined

See original GitHub issue

Hi,

when using dynamic import via ember-auto-import under Embroider the application throws error:

Error while processing route: marketplace.primary.index emberAutoImportDynamic is not defined ReferenceError: emberAutoImportDynamic is not defined
    at IntlService.polyfills (webpack:///./services/intl.js?:204:103)
    at IntlService.setupLocale (webpack:///./services/intl.js?:173:190)
    at ApplicationRoute.afterModel (webpack:///./application/route.js?:97:21)

The issue can be resolved by removing ember-auto-import/babel-plugin from ember-cli-build.js (https://github.com/ef4/ember-auto-import#dynamic-import).

Is it correct way and thus https://github.com/embroider-build/embroider#how-to-try-it may be enhanced?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
simonihmigcommented, Feb 7, 2021

The issue can be resolved by removing ember-auto-import/babel-plugin from ember-cli-build.js (https://github.com/ef4/ember-auto-import#dynamic-import).

FWIW, I have been successfully using import() in Embroider, and have never added that babel plugin. So yes, it seems it is at least unnecessary in an Embroider world, and if it breaks things in your case, apparently it is also harmful.

0reactions
ef4commented, Feb 8, 2021

Yeah, my bad, the docs showed the wrong pattern for a long time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ef4/ember-auto-import: Zero config import from npm packages
ember -auto-import will refuse to import devDependencies of your addon into addon code (because that would fail in a consuming application). · ember-auto-import...
Read more >
EmberJs - unable to implement dynamic-import-polyfill
We are trying to implement dynamic-import-polyfill to import external file Ember compile time(build time). Followed steps mentioned in https:// ...
Read more >
Need help using ember-auto-import dynamic import
I'm using dynamic import for perhaps the first time and finding myself in the deep end of the build pool. We are generating...
Read more >
referenceerror: navigator is not defined react - You.com
First, you need to make sure that you import react-codemirror and your desired themes and modes using Dynamic imports. To do this, import...
Read more >
How i can solve Electron error: "Buffer is not defined"?-ember.js
ember -cli-build.js // ... let app = new EmberApp(defaults, { // ... autoImport: { webpack: { plugins: [ new webpack.ProvidePlugin({ Buffer: ['buffer' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found