v4.3.1 may break ember-auto-import usage
See original GitHub issue- I am on the latest ember-intl version
- I have searched the issues of this repo and believe that this is not a duplicate
Environment
- Ember Version: 3.17.3
- Ember CLI Version: 3.17.0
- Ember Intl Version: 4.3.1
- Browser(s): any modern browsers
- Node Version: 12.16.2
NOTE: This issue is may not an actual bug, but if you encounter the same thing, this may be helpful for you.
Preconditions:
- using
ember-auto-import
- import any module that relies on node API (not sure if this assumption is too widen)
- upgrade older
ember-intl
to v4.3.1 (or v5.0.0-beta.1)
you might see a broken build with errors related to ember-auto-import
, for example:
but it’s actually has nothing to do with ember-intl
, even it happened just after you upgrade it.
The reason behind is due to this PR: https://github.com/ember-intl/ember-intl/pull/1230
The simple solution is to put this config into your own ember-cli-build.js
:
const app = new EmberApp(defaults, {
autoImport: {
webpack: {
node: {
global: false, // or true, doesn't matter on this issue
},
},
}
});
I’m not sure if this is a bug of ember-auto-import
, or people should always set this config by themselves. A lot of users are using ember-intl
(including me), it did this for us unintentionally in a long period of time.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Webpack Returned Errors to ember-auto-import - Questions
I have a problem build error like title of my topic, anyone can help me? devDependencies: { "@ember/jquery": "^0.5. 2", "@ember/optional- ...
Read more >Can't load module that imports css via ember-auto-import
@ckeditor/ckeditor5-image/src/image imports a CSS file. As CKEditor uses CSS-in-JS and other features not part of ECMAScript specification ...
Read more >ember-auto-import - npm
Start using ember-auto-import in your project by running `npm i ... There are 615 other projects in the npm registry using ember-auto-import.
Read more >Changelog - ember-bootstrap
In most cases this should not affect you, but there are some edge cases where it might break, e.g. using ember-test-selectors with the...
Read more >yoember.com: Ember.js Octane Tutorial - From beginner to ...
//app/controllers/index.js import Controller from '@ember/controller'; ... Important note if you use Ember v3.4 or later with EmberFire.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@st-h the
global
option here is to refer the top-level object in Node.js environment (in browser this object is calledwindow
)We use webpack to import 3rd-party libs, some of them use
global
in its source, to make them work, you have to tell webpack: please expose theglobal
variable to those node.js compatible libs.It’s often been required in two scenarios:
global
in SSRI use
global: false
in the code snippet because my situation only matches the 2nd point, I have to tell webpack to work with node.js lib but don’t have to expose theglobal
variable.I’ll keep this issue open for visibility for the time being.
To summarize, we were masking a bug in your app. Your app was indirectly relying on ember-intl to set an ember-auto-import config option,
webpack.node.global
, that you have should have been setting yourself.ember-intl no longer needs
webpack.node.global
on but your app still does because some other either your app or another addon is trying to import a node module that references Node’sglobal
object.