-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module not found: Error: Can't resolve 'core-js/modules/es6.function.bind #119
Comments
Oh hmm sorry for the trouble. Maybe due to the dependency updates in #117 Did you get any npm warnings like missing peerDependencies when you upgraded? Does v5.6 work fine for you? |
@tizmagik I downgrade to 5.6 and I'm still getting errors, and not, I'm not getting missing peerDependencies with 5.7. I think it is because I'm using @babel/[email protected] and core-js@3, corejs 3 don't have the packages es7.symbol.async-iterator, web.dom.iterable', etc. But I don't know why it only fails in react-tracking 🤔 . Is react-tracking using another way to bundle the code? Thanks! |
Hmm we haven’t changed the way we build the code. We assume any polyfills are done in userland, that’s why the peerDependency on core-js. Happy to look at a repro or something but not sure if this is specific to react-tracking or if it’s just how your polyfills are applied in your app? |
@tizmagik I will try to create a repro this weekend |
FWIW, we have seen the same issue after upgrading to |
Thanks @jacekradko -- do you have a repro you could point to, or would you know off-hand what we might be missing on react-tracking side? We haven't changed how we're bundling so I guess it's something to do with how babel runtimes work or something? 🤷♂️ |
@tizmagik running into this too, will try to put together a repro if i have time. I'd guess that upgrading the dependency in react-tracking, and then publishing a new build will resolve the issues. |
Possible (likely) related issue in babel, updates to babel config seem to be the answer: Additional info (migration guide): https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpreset-env |
Reproduction: https://github.com/mckernanin/react-tracking-corejs-v3-repro/tree/master/ New app with CRA, install |
Hmm releasing this in v7.0.0 and using it in a couple of apps at NYT caused build failures,
Maybe that means we don't have babel configured correctly, OR we're not building react-tracking correctly but either way I think I want to pull this change out of |
@tizmagik did you upgrade core-js in those projects? |
@mckernanin yes, I explicitly listed core-js@3 as a dependency (it was a transitive dependency before that) and it still resulted in build failures. I think the issue is that it's not as simple as upgrading core-js to v3, but that it requires babel configuration updates as well. Maybe we can figure out a better way to build react-tracking so that's not necessary but for now I rather keep the Hooks release separate. My own fault for wanting to lump these two things together 😅 |
No worries. 7.0.0 works properly with |
Ah yea you're right, if I update our babel configuration to: "presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
+ "corejs": 3
}
], And ensure that But, I rather not have folks need to mess with their babel configuration (specifically folks not relying on react-scripts). Maybe we need to move to using microbunlde or something. |
Just gave this a spin in our app and adding these options didn't work -- because we're on a lower version of babel 7; the We could update no problem, but I wonder if it might be better to bundle these requirements up in the build to NPM rather than requiring folks to install additional packages and update config? Will be very hard to coordinate across so many different setups. What about users who don't use Babel? Making |
So if I set Maybe that's okay for now until we have time to figure out a better way to build/bundle react-tracking? I published a pre-patch against alpha tag, v7.0.1-0 @damassi mind giving that a spin in your app to see if it solves your build issues?
Also open to other ideas! 🤗 |
@tizmagik - works great 👍 As an interim I agree it's probably ok so that consumers don't break / require additional setup, but also that it can be improved upon. Will give a think when I get a sec. |
I'm getting this error after upgrade to v5.7.0
It is the only package that give me that error 🤔
Maybe it is because I'm using core-js v3? 🤔
The text was updated successfully, but these errors were encountered: