Closed deluxefx closed 8 months ago
Thanks for creating an issue! Can you create a minimal reproduction at https://astro.new? Hard to tell without it
No error when i installed on a minimal project from astro.new
Is it possible for you to test on https://github.com/onwidget/astrowind ?
Would be even better if you had a repo using astrowind and my integration! If not, I'll do it! Can you just run astro info
and give me the result?
`npx astro info 7:26:39 PM [vite] Pre-transform error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension. [astro] Unable to load your Astro config
Expression expected Stack trace: at error (file:///Users/iamtra/Next_JS/astrowind-maint/node_modules/rollup/dist/es/shared/parseAst.js:337:30) at convertNode (file:///Users/iamtra/Next_JS/astrowind-maint/node_modules/rollup/dist/es/shared/parseAst.js:2057:12) at parseAstAsync (file:///Users/iamtra/Next_JS/astrowind-maint/node_modules/rollup/dist/es/shared/parseAst.js:2108:12) at async loadAndTransform (file:///Users/iamtra/Next_JS/astrowind-maint/node_modules/vite/dist/node/chunks/dep-9A4-l-43.js:49789:11) iamtra@Umits-MacBook-Air astrowind-maint % `
alright I'll give it a shot and get back to you
I can reproduce 👍, https://github.com/florian-lefebvre/astro-loading-indicator-astrowind-debug
Oh thats good. What may cause this? "Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension."
Tbh that's the first time I see this error, I've asked for help on Astro's Discord
Hi @Florian, I, too, was not able to quickly spot the cause of this error, but it does not come from the integration part, but from the stand-alone component.
If people just want to use the automatic integration and not the "loading indicator as an dedicated Astro component", deleting line 3 (export { default as LoadingIndicator } from "./LoadingIndicator.astro";
) from index.ts might help. Alternatively, version 0.0.1 (which was before the loading indicator as component was added) also seems to work fine.
Sorry ^^^^ wrong mention @florian-lefebvre ^^^
@martrapp thank you! So what you suggest is that I have another export for the standalone component instead of a barrel file?
The bag exports .astro files and that works well. When you import them you have to import form "xyz.astro" but that's fine.
Maybe you should give it a try and see what happens when you rename index.ts to index.tsx?
I think I'll simplify this package to just export a component, makes more sense than an integration!
@martrapp with the component I get Uncaught SyntaxError: The requested module '/node_modules/nprogress/nprogress.js?v=dc65122b' does not provide an export named 'configure'
, do you know why? Here is a repro https://stackblitz.com/edit/github-vssgk8?file=src%2Fpages%2Findex.astro
Looks like nprogress doesn't want to be imported from a ECMAScript Module. Its export code looks a bit strange. Last nprogress release was May 2015?
I consider this issue fixed although the code is not working yet. Resolution in #2
I could not install this.
Re-optimizing dependencies because lockfile has changed 11:42:20 AM [vite] Pre-transform error: Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension. [astro] Unable to load your Astro config