Skip to content
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

core-js dependency #6

Open
bpierre opened this issue Apr 5, 2021 · 7 comments
Open

core-js dependency #6

bpierre opened this issue Apr 5, 2021 · 7 comments

Comments

@bpierre
Copy link

bpierre commented Apr 5, 2021

Hi, thanks for rollpkg, I started to use it on a few projects and it feels great!

I just wanted to open this issue to track one I was having with the csso-webpack-plugin dependency (via package-build-stats): zoobestik/csso-webpack-plugin#28

The temporary fix is to have core-js as a devDependency in my library. Until csso-webpack-plugin and package-build-stats receive publish a new version, maybe core-js could be added as dependency in rollpkg?

@rafgraph
Copy link
Owner

rafgraph commented Apr 5, 2021

I'm not sure I understand the what the issue is? Is it possible to reproduce? Thanks.

@bpierre
Copy link
Author

bpierre commented Apr 5, 2021

Sorry, this is the error I was getting on build:

$ yarn build
internal/modules/cjs/loader.js:1088
  throw err;
  ^

Error: Cannot find module 'core-js/modules/es.string.replace.js'
Require stack:
- /home/pierre/s/use-nft/node_modules/csso-webpack-plugin/lib/index.js
- /home/pierre/s/use-nft/node_modules/package-build-stats/build/config/makeWebpackConfig.js
- /home/pierre/s/use-nft/node_modules/package-build-stats/build/utils/build.utils.js
- /home/pierre/s/use-nft/node_modules/package-build-stats/build/getPackageStats.js
- /home/pierre/s/use-nft/node_modules/package-build-stats/build/index.js
- /home/pierre/s/use-nft/node_modules/rollpkg/dist/bundlephobiaStats.js
- /home/pierre/s/use-nft/node_modules/rollpkg/dist/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1085:15)
    at Function.Module._load (internal/modules/cjs/loader.js:928:27)
    at Module.require (internal/modules/cjs/loader.js:1145:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (/home/pierre/s/use-nft/node_modules/csso-webpack-plugin/lib/index.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1256:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
    at Module.load (internal/modules/cjs/loader.js:1105:32)
    at Function.Module._load (internal/modules/cjs/loader.js:967:14)
    at Module.require (internal/modules/cjs/loader.js:1145:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/pierre/s/use-nft/node_modules/csso-webpack-plugin/lib/index.js',
    '/home/pierre/s/use-nft/node_modules/package-build-stats/build/config/makeWebpackConfig.js',
    '/home/pierre/s/use-nft/node_modules/package-build-stats/build/utils/build.utils.js',
    '/home/pierre/s/use-nft/node_modules/package-build-stats/build/getPackageStats.js',
    '/home/pierre/s/use-nft/node_modules/package-build-stats/build/index.js',
    '/home/pierre/s/use-nft/node_modules/rollpkg/dist/bundlephobiaStats.js',
    '/home/pierre/s/use-nft/node_modules/rollpkg/dist/cli.js'
  ]
}

@rafgraph
Copy link
Owner

rafgraph commented Apr 6, 2021

I added core-js as dependency as a temporary fix. Please install rollpkg v0.5.4. I'm going to leave this issue open as a reminder to remove core-js when this is fixed upstream.

@bpierre
Copy link
Author

bpierre commented Apr 6, 2021

Oh that’s great, thank you!

@rafgraph
Copy link
Owner

rafgraph commented Apr 6, 2021

Yeah I hadn't seen the error before and wasn't able to reproduce it until I regenerated rollpkg-example-package's lock file. But seeing as it would affect every fresh install of rollpkg, a fix was required.

@bpierre
Copy link
Author

bpierre commented Apr 6, 2021

Interestingly, I noticed this issue by migrating a new project to rollpkg, while use-nft was working well. Then at some point, I started to have the issue on use-nft as well − probably after I deleted the lockfile.

So I suspect core-js was the dependency of another module before (maybe not even related to rollpkg, it could be eslint, prettier or something else every project uses), and a minor upgrade in that module removed it, breaking the implicit dependency in csso-webpack-plugin.

bpierre added a commit to bpierre/use-nft that referenced this issue Apr 7, 2021
bpierre added a commit to bpierre/use-nft that referenced this issue Apr 7, 2021
Also:

- Remove core-js, see rafgraph/rollpkg#6 (comment)
- Dependabot checks: move to weekly.
@zoobestik
Copy link

Fixed in [email protected]

midas19910709 added a commit to midas19910709/Use-NFT that referenced this issue May 4, 2022
Also:

- Remove core-js, see rafgraph/rollpkg#6 (comment)
- Dependabot checks: move to weekly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants