Closed mikhin closed 1 year ago
I'll need a minimal reproduction.
rolled back to "vite-plugin-ssr": "0.4.133" and everything goes successfully
That's quite unexpected. A minimal reproduction is much needed here. I'll probably be able to quickly fix it as not much changed in that space between 133
and 135
.
rolled back to "vite-plugin-ssr": "0.4.133" and everything goes successfully
The same situation.
Please someone provide a reproduction.
Closing. I'll re-open once someone provides a reproduction.
Same error.
npm run dev
npm run build
"initReactI18next" is not exported by "virtual:vite-plugin-ssr:empty-module", imported by "services/i18n.ts".
file: /foo/bar/vite-ssr/apps/client-web/services/i18n.ts:5:9
3: import LanguageDetector from 'i18next-browser-languagedetector';
4: import resourcesToBackend from 'i18next-resources-to-backend';
5: import { initReactI18next } from 'react-i18next';
^
6:
7: const locales = ['en', 'pt'];
error during build:
RollupError: "initReactI18next" is not exported by "virtual:vite-plugin-ssr:empty-module", imported by "services/i18n.ts".
at error (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
at Module.error (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:13716:16)
at Module.traceVariable (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:14146:29)
at ModuleScope.findVariable (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:12589:39)
at ReturnValueScope.findVariable (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:7124:38)
at ChildScope.findVariable (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:7124:38)
at TrackingScope.findVariable (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:7124:38)
at BlockScope.findVariable (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:7124:38)
at Identifier.bind (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:8309:40)
at CallExpression.bind (file:///foo/bar/vite-ssr/node_modules/rollup/dist/es/shared/node-entry.js:5888:28)
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @me/client-web@0.0.0
npm ERR! at location: /foo/bar/vite-ssr/apps/client-web
I found the issue.
For those who may face it in the future. I added paths to my tsconfig.json
. So, check your vite.config.ts
and add the proper resolve aliases.
Note to self, DO NOT USE vite-tsconfig-paths
plugin!!!
Check this out. https://github.com/marviobezerra/vite-ssr/pull/1/files
@marviobezerra Thanks for the reproduction and solution.
I can confirm that vite-tsconfig-paths
is the issue. Using it is now forbidden in 0.4.139
and, as suggested by @marviobezerra, use vite.config.js#resolve.alias
instead.
Description
Hi! Big thanks for your work on this project. I recently started getting an error and was wondering how to fix it.
package.json
Log
one more log
vite.config