What / Why
I just upgraded from semver@5.x to semver@latest and now my react app crashes
Seems to be related to the lazyRequire function.
Looks like webpack is optimizing out the functions.
When
import semver from "semver";
....
this.isAppValid = ver => {
return semver.valid(ver) !== null;
}
Where
semver_sync:2 Uncaught Error: Cannot find module './functions/valid'
at webpackEmptyContext (semver_sync:2)
at lazyRequire (index.js:3)
at Object.get [as valid] (index.js:10)
at StrapTable.eval [as isAppVerValid] (userOverview.jsx:409)
How
Current Behavior
crash
Steps to Reproduce
This only happens when I run webpack to build a deployment package (mode doesn't matter, happens in both production and development modes)
Expected Behavior
work like 5.x
What / Why
I just upgraded from semver@5.x to semver@latest and now my react app crashes
Seems to be related to the lazyRequire function.
Looks like webpack is optimizing out the functions.
When
import semver from "semver";
....
this.isAppValid = ver => {
return semver.valid(ver) !== null;
}
Where
semver_sync:2 Uncaught Error: Cannot find module './functions/valid'
at webpackEmptyContext (semver_sync:2)
at lazyRequire (index.js:3)
at Object.get [as valid] (index.js:10)
at StrapTable.eval [as isAppVerValid] (userOverview.jsx:409)
How
Current Behavior
crash
Steps to Reproduce
This only happens when I run webpack to build a deployment package (mode doesn't matter, happens in both production and development modes)
Expected Behavior
work like 5.x