You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I found a bug while building an application with snowpack, where one of the package is yarn link: the result file is common-js (snowpack uses common-js entry point of the package.json in this particular situation).
This result in a success build, but in an unusable application in the browser (missing module.exports and require).
Here are the steps to reproduce the bug (I created for you a demo repo to reproduce it):
When installing normally the package (yarn install instead of yarn link "@lifaon/hello-world"), the hello-world package is correctly build and the app works juste fine.
I did not test with npm link but I guess the problem will be the same.
For more precision, don't hesitate to ask for any help.
PS: this issue #429 is related, but it's not really the same problem: in my case the build in incorrect, where in 429, its related to the hot reloading.
The text was updated successfully, but these errors were encountered:
We just created a PR that adds support for better handling of npm linked packages, I'd love your feedback on it and hopefully it fixes your issue: #2707
Hi, I found a bug while building an application with snowpack, where one of the package is
yarn link
: the result file is common-js (snowpack uses common-js entry point of the package.json in this particular situation).This result in a success build, but in an unusable application in the browser (missing
module.exports
andrequire
).Here are the steps to reproduce the bug (I created for you a demo repo to reproduce it):
Install the package locally: https://github.com/lifaon74/hello-world
cd ./hello-world/build yarn install npm run build npm run link:package
Install the snowpack test env: https://github.com/lifaon74/snowpack-test
cd ./snowpack-test npm run link:hello-world npm run build
Here's the build result: https://github.com/lifaon74/snowpack-test/blob/main/build/_snowpack/pkg/%40lifaon/hello-world.js
(I've commit the full build there: https://github.com/lifaon74/snowpack-test/tree/main/build)
As you may see it's common-js resulting in TypeError when loading it on a browser.
The package properly exports boths cjs and mjs: https://www.skypack.dev/view/@lifaon/hello-world
When installing normally the package (
yarn install
instead ofyarn link "@lifaon/hello-world"
), the hello-world package is correctly build and the app works juste fine.I did not test with
npm link
but I guess the problem will be the same.For more precision, don't hesitate to ask for any help.
PS: this issue #429 is related, but it's not really the same problem: in my case the build in incorrect, where in 429, its related to the hot reloading.
The text was updated successfully, but these errors were encountered: