-
Notifications
You must be signed in to change notification settings - Fork 923
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
Migration from CRA to Snowpack 2.0, library compatibility problem #364
Comments
I've been trying to find out what is happening, pretty much only by having more files in my If I have this code, with a single
|
I've also tried the config below, still the same issue. snowpack.config.js
|
Thanks for filing! neither React & ReactDOM are very ESM friendly, we have a manual workaround for React but I didn't realize we might need one for ReactDOM as well. Added 76e2ee6 to fix, will go out in the next version |
Any date for the next version? |
releasing it now! |
Nice! |
Snowpack ran fine, except that due to other libraries I wont be able to use snowpack in my projects, there was no error in the Thanks anyways. |
Would love to see the console logs / errors, if you don't mind sharing! |
Sure, here it is. If one import is removed, it complains about another, that single line with a blank screen, and the screen trying to be rendered doesn't have the table in it. https://i.postimg.cc/Qd2fg20Y/0errors.png If I remove all imports from
If I try to import an asset from I tried to add a env var to
Very weird behavior, I use |
So, I am using GraphQL with
Preview was just this
I think that's it. |
@dougg0k thanks for the info, that really helps. For reference for anyone else who hits this:
|
With:
Since I didnt find any way to import from public folder in the docs, I tried that. |
Yup, that should have worked. I'll try to reproduce on my end. Fwiw Snowpack does support images in the src/ directory, if that helps. |
Ah, I see the problem. This should have been:
Since your import is run in the browser, and the public directory has been mounted to We should still have a better error message for you though, besides just "bad MIME type" |
Hm, cool. Thanks for letting me know. |
I'm having a similar issue:
Note that |
That's super strange, I don't know what could be causing that. We just pushed a bunch of installer fixes in the last couple of versions, maybe there's a fix in there for this? |
I don't face this issue when installing dependencies using Update:I ran Thank you |
@FredKSchott thank you so much for taking the time to give such detailed responses to the various issues raised here! I beg leave to burden your generosity a bit more—I'm happy to move this to its own issue but I thought to start by posting it here because I think it benefits from the above discussion. I'm running into the same npx create-snowpack-app new-dir --template @snowpack/app-template-react-typescript
cd new-dir
npm i io-ts fp-ts Then, if I add the following code snippet to the bottom of import * as t from 'io-ts'
// import { PathReporter } from 'io-ts/lib/PathReporter' // per https://github.com/pikapkg/snowpack/issues/364
import PR from 'io-ts/lib/PathReporter'
const User = t.type({
userId: t.number,
name: t.string
})
const result = User.decode({ name: 'Giulio' })
console.log(PR.PathReporter.report(result)) This is fine! However!, if I add the following two lines to the bottom: import E from 'fp-ts/lib/Either'
console.log(E.isRight(result)); I get the following error:
If I'm reading this stacktrace correctly, what's happening is that both my code and The frustrating thing is, if I remove these offending two lines, I continue getting the same error message, even if I restart I did find a way to snap my app out of its zombie state:
So there are a couple of issues that might be of interest here:
Again, apologies for burdening you with more questions about this topic, I'm happy to move it to its own issue if you'd like. |
Hi,
I was trying to migrate a project to Snowpack 2.0 from CRA and I got this, is there anything that can be done on my end to make it work?
Thanks!
Edit:
I've just tried importing
dayjs/esm
and it worked, but now I get the same issue withreact-dom
, all libraries are in the latest version.The text was updated successfully, but these errors were encountered: