@snowpack/plugin-svelte can't import Svelte files from a pnpm monorepo #1814
Unanswered
antony
asked this question in
Troubleshooting
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Not sure whether this is one issue or two issues, but either way it's a blocker for Snowpack usage which has been plaguing me for some time, and seems to have become worse with the more recent minor release.
Fundamentally I have a simple monorepo with this layout:
The repo is managed by rush, which uses pnpm.
If I import C into App, everything works fine.
If I import A or B into App, two things happen:
snowpack dev --reload
which makes snowpack usage basically pointless, since the dev cycle is just restart, restart, restartThe file it is failing to load is called
A.svelte.proxy.js
which differs to the app-local fileC.svelte
which it requests without theproxy.js
extension.If I inspect the file it has been loaded with type
application/octet-stream
rather than the expectedapplication/javascript
. The contents are an uncompiled Svelte component. The way this differs from the componentC.svelte
which lives inside the snowpack app (i.e. is not a module in the monorepo) is that when C is loaded (which works fine), it:proxy
in the URL:http://localhost:8080/C.js
application/javascript
.Not sure what's going on exactly so insights would be much appreciated.
I've included the repo for reproduction:
https://github.com/antony/rush-and-snowpack
Steps to reproduce:
Open your browser console and you can see the error.
Beta Was this translation helpful? Give feedback.
All reactions