-
Notifications
You must be signed in to change notification settings - Fork 143
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
Setting up Astro with Stackblitz #281
Comments
@aFuzzyBear The underlying issue is our lack of ESM modules (and dynamic |
you bunch of legends, thank you very much for your response guys, if there is anything i could do to help, please just let me know =) |
Hey yall, just saw this tweet! https://twitter.com/stackblitz/status/1422960937129086976 I just tried Astro again and it still silently exits on this line of our CLI entrypoint: https://unpkg.com/astro@0.18.8/astro.cjs
Happy to prioritize anything on our end to get this working! Would love to add some "edit on Stackblitz" links to our docs site & examples. |
@FredKSchott hey, yes, dynamic imports from CJS modules are a known limitation of our ESM implementation. We can't give you an estimate on when we'll come around to fix it though. FWIW a pure ESM version should work... not sure if that's an option for you folks. |
We could look into that! This CJS file is mainly used to check that the user's environment supports ESM before loading the ESM entrypoint. Is there any way to give Stackblitz an ESM only entrypoint that skips this CJS env check? |
I noticed your
There isn't any "magic Stackblitz hook" that you could use at the moment, but a dual package would allow you to support both "legacy" and "modern" versions of Node, and it would sidestep this issue, as we would pick the |
Oh, we're fully committed :) But unfortunately when you were to run our ESM package in a non-ESM version of Node, it gives a really difficult to parse error that threw off a lot of first-time users. This file purely exists to help the non-ESM users understand what when wrong, and how to fix. BUT I think we can improve the file to run in both ESM and CJS, and then Stackblitz would assume ESM. If I follow your comment above, |
@jrvidal Okay, that issue was fixed! Now seeing an issue on esbuild. Didn't I see something about Same project as @aFuzzyBear shared: https://stackblitz.com/edit/node-tna5ax?file=package-lock.json |
I'm also seeing a few other dynamic import issues:
It seems that
We do swap |
Ah, it seems that we didn't swap |
Great! That's |
Hey @FredKSchott 👋 I'll chime in here too because I have been working on a couple of things that address this issue. As @jrvidal mentioned we always swap I have implemented dynamic imports for CJS but it's an {
"env": {
"ENABLE_CJS_IMPORTS": true
}
} This will enable Here's an example project you can look at. @SamVerschueren has been testing Astro again on our end with this feature enabled but we are still seeing some issues related to |
No problem! We're going to look into some larger fixes in our build engine and will try to tackle on our end. |
Awesome. Thanks a lot. We'll investigate on our end for sure too. |
Hey everyone 👋 ! We have some exciting news for you because we have Astro working on StackBlitz right now 🔥 Here's a project you can use to test this with https://stackblitz.com/edit/node-mkjkny. Happy coding! |
Would it be possible to import git repos via subfolders? |
@jasikpark You can import sub-directories using the GitHub importer, e.g. |
Hey Stackblitz, Thanks for doing this guys, really its awesome.... Just following up on @d3lm comment about installing peer-deps, how would one do this then? |
@aFuzzyBear Similar to how it works with yarn or npm, you need to define all peer dependencies as dependencies in your |
|
I just looked into it and it doesn't seem to be related to peer dependencies actually. The problem is that that sub-directory relies on a workspace higher up:
That won't work because the importer only imports files from that sub-directory going downwards, but not upwards. So if you want to import a sub-directory you have to make sure it's self-contained and has everything it needs to run on its own. |
That missing peer dep is definitely something that we can fix on our end! @aFuzzyBear any interest on adding '@astrojs/renderer-solid' as a dependency of the frameworks-multiple example project? |
I will check the templates and make sure that they |
Describe the bug
Hello folks,
I was having issues trying to setup the npm pkg : Astro by snowpackjs with your platform. My intention is to have online demonstrations for the Astro templates and community projects.
I originally tried using the url
https://stackblitz.com/snowpackjs/astro/blob/main/examples/starter
to only have your system hang and crash 😓My alternative strategy was to start building out the examples, only to have the problem where it doesnt start the dev server nor the build command, I was wondering if you could possibly help me out.
As I mentioned, I intend to have this placed in the astro docs for users to have a quick demonstration of this amazing framework.
I greatly appreciate your support,
Link to the blitz that caused the error
https://stackblitz.com/edit/node-tna5ax?file=package.json
Steps to reproduce
Expected behavior
should start Astro's dev server
http://localhost:3000
should produce a
./dist
output folder containing the static site that Astro generates.Screenshots
No response
Platform
Additional context
Really would appreciate any support with this,
Many Thanks
🖖
The text was updated successfully, but these errors were encountered: