-
Notifications
You must be signed in to change notification settings - Fork 248
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
import { renderMetaToString } from 'vue-meta/ssr/index.js'; does not work #684
Comments
Are you using // webpack.config.ts
import nodeExternals from 'webpack-node-externals'
export default {
externals: [
// Do not externalize dependencies that need to be processed by webpack.
// You should also whitelist deps that modify `global` (e.g. polyfills)
nodeExternals({
allowlist: [
/^vue-meta*/,
/\.(css|sass|scss)$/,
/\.(vue)$/,
/\.(html)$/,
],
}),
],
}
|
It wasn't included in the allowlist, but now I added it and still get the same error. I am not using Typescript, so my config is webpack.config.js |
Can you paste your entire |
If you are using babel-loader you will have to include vue-meta so it will be transformed. See eg webpack/webpack#2031 (comment) |
Thank you pimlie. To start my dev server I use babel-node like this:
How can I include |
Try setting |
Thank you for the suggestion. Even after adding the ignore I get the error "SyntaxError: Unexpected token 'export'". But in my production build using Webpack I have included
|
Thanks for your contribution to vue-meta! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like this issue to remain open:
|
error: SyntaxError: Unexpected token 'export' related thread: nuxt/vue-meta#684
Does anyone know how to transform |
I met the same quesetion when I use vite ssr |
Thanks for your contribution to vue-meta! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you would like this issue to remain open:
|
Following this example code, I am trying to import
renderMetaToString
but it keeps failing with the following error:The code that exports
renderMetaToString
looks like this...vue-meta\ssr\index.js:
I am using
Webpack
withbabel
to processserver.js
so usingimport
works fine. Myserver.js
imports are like this:server.js
If I comment out the
import {renderMetaToString} ...
part, then everything runs fine. So it can't be theimport
syntax causing the issue or else the others would also fail. However, even if I change them all to userequire
I still get theSyntaxError: Unexpected token 'export'
error.What is the issue and how to fix it?
The text was updated successfully, but these errors were encountered: