Open WilsontheWolf opened 3 years ago
I believe I'm having the same issue. Recently upgraded to snowpack 3.3.0 and use-sound
stopped working. The use-sound
module tries to lazy load howler
and I get this issue when I yarn start:
Cannot find module ''howler'' from /frontend/app/node_modules/use-sound/dist/use-sound.esm.js
This was working fine until the upgrade from 3.1.0, which I had to move away from because I was having issues with this bug: https://github.com/snowpackjs/snowpack/issues/2948
I believe I'm having the same issue. Recently upgraded to snowpack 3.3.0 and
use-sound
stopped working. Theuse-sound
module tries to lazy loadhowler
and I get this issue when Iyarn start:
Cannot find module ''howler'' from /frontend/app/node_modules/use-sound/dist/use-sound.esm.js
This was working fine until the upgrade from 3.1.0, which I had to move away from because I was having issues with this bug:
2948
I'm having the same issue, I believe this is quite an urgent bug since it completely breaks dev/prod builds.
Think this bug is similar: https://github.com/snowpackjs/snowpack/issues/3370
Bug Report Quick Checklist
Describe the bug
When a module dynamically imports a file relative to itself it fails. This is due to the fact that all modules are stored in one dir. I'm using a module that lazy loads its components. As such it dynamically imports them as a relative import. The script importing is
@skyra/discord-components-react/dist/index.js
. Snowpack loads this as@skyra.discord-components-react.dist.index.es.v2.0.3-alpha.0.js
. However, when it imports the module it does./module
which normally is@skyra/discord-components-react/dist/module
. However, due to the way snowpack loads, it is not in its sub-dir. As such ./module resolves to snowpack pkg dir instead of the@skyra/discord-components-react/dist/
. The solution to this would be to allow snowpack to load it in the traditional module sense. Would this be an option to load my module with the dir structure it will?To Reproduce
We can't fix bugs that we can't see for ourselves. Issues often need to be closed if this section is skipped.
I set up a minimal repo if you just want to clone that https://github.com/WilsontheWolf/import-bug
yarn create snowpack-app import-bug --template @snowpack/app-template-react --use-yarn
yarn add @skyra/discord-components-core@alpha @skyra/discord-components-react@alpha
function App() { return (
}
export default App;