compiler
compiler copied to clipboard
🐛 BUG: Transform couldn't find `astro/internal`
What version of @astrojs/compiler
are you using?
0.14.2
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the Bug
When using the transform
method imported from @astrojs/compiler, I get this error, saying that astro/internal
couldn't be found:
Cannot find module 'astro/internal' imported from '/home/projects/github-dm6xxp-hnfnvq/src/pages/index.astro'
Error: Cannot find module 'astro/internal' imported from '/home/projects/github-dm6xxp-hnfnvq/src/pages/index.astro'
at viteResolve (/home/projects/github-dm6xxp-hnfnvq/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:59357:25)
at nodeImport (/home/projects/github-dm6xxp-hnfnvq/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:59392:15)
at ssrImport (/home/projects/github-dm6xxp-hnfnvq/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:59288:20)
at eval (/home/projects/github-…
Note:
- Changing
internalURL
to the absolute path makes a new error appear:
failed to load module for ssr: ../astro/internal
Error: failed to load module for ssr: ../astro/internal
at instantiateModule (/home/projects/github-dm6xxp-hnfnvq/node_modules/vite/dist/node/chunks/dep-59dc6e00.js:59253:15)
I tried adding astro
to vite.ssr.external
and vite.optimizeDeps.exclude
(via updateConfig or as part of the original astro.config.mjs
file) but the issue persists.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-dm6xxp-hnfnvq?file=packages%2Fplugin.js,astro.config.mjs
@Yan-Thomas have you found a solution for this?
Unfortunately no, @armedi
Sorry for the super long delay on this! astro/internal
used to be how we referenced our server runtime but it was moved to astro/runtime/server/index.js
. I'm going to update our defaults.