Comments (6)
Hey @wmertens. I'm guessing you are doing something out of order. Are you using something imported before its imported? We had another bug like this related to exporting things before they were imported.
Do you have anything like
doSomething();
// ...
import {doSomething} from './some-file';
Just want to confirm so my regression test to go along with the fix keeps this from popping up again later.
from hard-source-webpack-plugin.
from hard-source-webpack-plugin.
I added a console.log(this)
and this error happens for this this
:
HardHarmonyImportSpecifierDependency {
module: null,
importDependency: undefined,
importedVar: null,
id: 'default',
name: 'Promise',
range: null,
loc:
{ start: { line: 5, column: 102 },
end: { line: 5, column: 109 } } }
I changed it to log for this.name === 'Promise'
and it turns out that the first run, it has Bluebird for Promise, and the second time, it shows the above output. So maybe something is using Promise before I polyfill it with Bluebird?
from hard-source-webpack-plugin.
All I needed to do was rename my bluebird import from Promise
to something else and it stopped happening. Weird, because I never assigned to the Promise global, it seems that global name clashes are not appreciated?
from hard-source-webpack-plugin.
Oh wow. I think the Promise
detail is exactly the issue. The good news is my 0.3.5
change in #80 works for this too. I'm guessing its a detail of the acorn parser webpack uses hoisting global names or some other similar mechanism effectively causing the specifier to appear before the import in the dependencies of that module.
I'm not worried about System.import
being the cause. Its basically a fancy require.ensure
dependency that doesn't have to deal with the more complex situations harmony imports and exports deal with.
Thanks for helping me figure this out @wmertens!
from hard-source-webpack-plugin.
🎉 can confirm it is fixed now!
Imports are hairy - I'm battling an issue where a Babel preset appears as an empty object unless I force-import it with node -r lib/myBabelPreset
:-/
from hard-source-webpack-plugin.
Related Issues (20)
- Error: Can't find options with ident 'vue-loader-options' HOT 1
- Not emitting CSS background images from package
- A problem when work with eslint
- Static assets are not generated on second build HOT 1
- This is a very good product
- exclude directory from all cache
- hard-source-webpack-plugin on Apple Silicon with M1 compatibility? HOT 1
- TypeError: Cannot read property 'call' of undefined HOT 1
- Should not use entire package.json as a hash. Should only use packageJson.dependencies HOT 1
- can not run with hard-source with cache.
- Failed to read cache during the second build HOT 3
- If I modify only one variable, do I have to cache it again?
- Webpack 5.x not supportted, because `compiler.hooks` can not add property HOT 5
- building new cache every time HOT 4
- https://github.com/mzgoddard/hard-source-webpack-plugin/issues/461#issuecomment-439177290
- Could not freeze HOT 6
- TypeError: Cannot read properties of undefined (reading 'tap') HOT 15
- Q: Should the property be cache set to true or it doesn't depend
- switch different mode to build application but no effect HOT 1
- The application runs incorrectly at the second packaging HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hard-source-webpack-plugin.