embroider-build / app-blueprint

[pre-alpha™️] Blueprint for next generation of Ember apps
32 stars 9 forks source link

Rollup fails to import component in template tag test (`.gts`) #54

Open IgnaceMaes opened 2 months ago

IgnaceMaes commented 2 months ago

Using the latest blueprint, I'm seeing the following behaviour when writing a component test using .gts. It errors when importing the component from the app folder.

x Build failed in 7.72s
error during build:
[vite]: Rollup failed to resolve import "my-app/components/my-component.gts" from "/<my-app>/tmp/rewritten-app/tests/integration/components/my-component-test.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteWarn (file:///<my-app>/node_modules/.pnpm/vite@5.4.1_@types+node@22.3.0_terser@5.31.6/node_modules/vite/dist/node/chunks/dep-Cy9twKMn.js:65471:17)
    at onRollupWarning (file:///<my-app>/node_modules/.pnpm/vite@5.4.1_@types+node@22.3.0_terser@5.31.6/node_modules/vite/dist/node/chunks/dep-Cy9twKMn.js:65503:5)
    at onwarn (file:///<my-app>/node_modules/.pnpm/vite@5.4.1_@types+node@22.3.0_terser@5.31.6/node_modules/vite/dist/node/chunks/dep-Cy9twKMn.js:65166:7)
    at file:///<my-app>/node_modules/.pnpm/rollup@4.21.0/node_modules/rollup/dist/es/shared/node-entry.js:18646:13
    at Object.logger [as onLog] (file:///<my-app>/node_modules/.pnpm/rollup@4.21.0/node_modules/rollup/dist/es/shared/node-entry.js:20301:9)
    at ModuleLoader.handleInvalidResolvedId (file:///<my-app>/node_modules/.pnpm/rollup@4.21.0/node_modules/rollup/dist/es/shared/node-entry.js:19236:26)
    at file:///<my-app>/node_modules/.pnpm/rollup@4.21.0/node_modules/rollup/dist/es/shared/node-entry.js:19194:26
mansona commented 2 months ago

Does this not now fix the problem? https://github.com/embroider-build/app-blueprint/blob/main/files/vite.config.mjs#L31-L33

are you sure you're on the latest copy of the blueprint?