-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with importing @gravity-ui/uikit: SyntaxError: Unexpected token 'export' Vinxi / Tanstack Start #1921
Comments
Same with remix-run |
For both project you need to pass |
Thank you for your help. There is a minor error in the "External" word in your response. Here is the complete configuration: // app.config.ts
import { defineConfig } from "@tanstack/start/config";
export default defineConfig({
server: {
preset: "node-server",
},
vite: { ssr: { noExternal: ["@gravity-ui/*"] } },
}); Despite the fact that ** so far** everything is working, an error is already appearing
|
I checked with other @gravity-ui libraries, the config above will not work, you need to set each library separately. // app.config.ts
import { defineConfig } from "@tanstack/start/config";
export default defineConfig({
server: {
preset: "node-server",
},
vite: {
ssr: {
noExternal: [
"@gravity-ui/uikit",
"@gravity-ui/components",
"@gravity-ui/icons",
],
},
},
}); |
Hello,
I'm experiencing an import error when trying to use
@gravity-ui/uikit
in my project. Upon starting the dev server, I encounter the following errors:Steps to Reproduce:
@gravity-ui/uikit
via npm:@gravity-ui/uikit
in the__root.tsx
file:Expected Behavior:
The dev server starts without errors, and components from
@gravity-ui/uikit
are successfully imported and used in the project.Actual Behavior:
I receive a syntax error when importing the module, indicating
Unexpected token 'export'
. There's also a warning suggesting to set"type": "module"
inpackage.json
or to use the.mjs
extension.Additional Information:
Thank you in advance for your assistance!
The text was updated successfully, but these errors were encountered: