You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm the author of astro-lottie-integration plugin.
It worked fine with the 1.9+. With the new 2 version, it breaks while bootstrapping.
It seems the new astro/vite version has trouble importing and re-exporting empty exports files.
In the main index.js:
export*from"./types"
where types.js is just:
export{}
The syntax is totally valid and shouldn't be a problem.
I don't know if it is a issue with astro itself or some configuration passed downstream to vite.
The repro is easy (already setup in the stackblitz link). In an empty astro site, just add the plugin
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/bjorn/Work/repros/astro-ssr-default/node_modules/.pnpm/[email protected]/node_modules/astro-integration-lottie/dist/types' imported from /Users/bjorn/Work/repros/astro-ssr-default/node_modules/.pnpm/[email protected]/node_modules/astro-integration-lottie/dist/index.js
at new NodeError (node:internal/errors:387:5)
at finalizeResolution (node:internal/modules/esm/resolve:429:11)
at moduleResolve (node:internal/modules/esm/resolve:1006:10)
at defaultResolve (node:internal/modules/esm/resolve:1214:11)
at nextResolve (node:internal/modules/esm/loader:165:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:844:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
I think this makes sense as in nodejs you need to specify the full ./types.js path to work. Though I'm not sure why it used to work. I'll create a issue in Vite to improve this error, and close this for now since the package needs to be fixed to work in nodejs.
What version of
astro
are you using?2.0.15
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Windows
Describe the Bug
I'm the author of astro-lottie-integration plugin.
It worked fine with the 1.9+. With the new 2 version, it breaks while bootstrapping.
It seems the new astro/vite version has trouble importing and re-exporting empty exports files.
In the main
index.js
:where
types.js
is just:The syntax is totally valid and shouldn't be a problem.
I don't know if it is a issue with astro itself or some configuration passed downstream to vite.
The repro is easy (already setup in the stackblitz link). In an empty astro site, just add the plugin
then in the
astro.config
fileWith the plugin, the site doesn't start as it crashes when calling the function
lottie()
. See giuseppelt/astro-lottie#2 for a detailed error.If I have to forward this to vite, it's fine for me.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-jvgdx2?file=astro.config.mjs&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: