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

@miniflare/core package seems to require itself, breaking pnpm-style installation #663

Closed
ajwootto opened this issue Aug 17, 2023 · 0 comments · Fixed by #664
Closed

@miniflare/core package seems to require itself, breaking pnpm-style installation #663

ajwootto opened this issue Aug 17, 2023 · 0 comments · Fixed by #664

Comments

@ajwootto
Copy link
Contributor

In the current distribution of @miniflare/core, the package contains a require('@miniflare/core') statement, thereby requiring itself. You can see it in the output here: https://www.npmjs.com/package/@miniflare/core?activeTab=code

on line 181 at the time of this writing.

The reason this is a problem is that when installing modules using pnpm, the node_modules/ directory is organized in a way where packages cannot require any package that is not explicitly declared in their package.json. I'm therefore experiencing an issue where I get an error like this (seen while running tests):

           Cannot find module '@miniflare/core'
           Require stack:
           - /Users/adamwootton/Code/taplytics/DevCycle/node_modules/.store/@miniflare-core-npm-2.14.0-6ecc6242bb/dist/src/index.js
           - /Users/adamwootton/Code/taplytics/DevCycle/node_modules/.store/@miniflare-shared-test-environment-npm-2.14.0-0855dfa67f/dist/src/index.js
           - /Users/adamwootton/Code/taplytics/DevCycle/node_modules/.store/jest-environment-miniflare-virtual-48ec0b4f0a/dist/src/index.js

I think this error would go away if the package was updated to not import itself and instead used relative imports of the files it needs

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

Successfully merging a pull request may close this issue.

1 participant