Skip to content

Commit d867bec

Browse files
Fixed signup-form dev server treating i18n as ESM (#25647)
no issue - when running `yarn dev` in the `signup-form` app, all instances of the form failed to render with the error: - `Uncaught SyntaxError: The requested module '/@fs/Users/kevin/code/Ghost/ghost/i18n/index.js' does not provide an export named 'default' (at app.tsx:2:8)` - the problem was that vite loads the monorepo `i18n` package using `/@fs/` and loads it as an ESM package despite being a CommonJS package - adding `@tryghost/i18n` to vite's `optimizeDeps` config forces the module to be transpiled so the import works correctly
1 parent 734c1cd commit d867bec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apps/signup-form/vite.config.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export default (function viteConfig() {
2424
allowedHosts: true, // allows domain-name proxies to the preview server
2525
port: 6174
2626
},
27+
optimizeDeps: {
28+
include: ['@tryghost/i18n']
29+
},
2730
build: {
2831
outDir: resolve(__dirname, 'umd'),
2932
reportCompressedSize: false,

0 commit comments

Comments
 (0)