[@vue/compiler-sfc] compileScript now requires passing the `id` option.
Version
3.0.4
Reproduction link
Steps to reproduce
version: "vue": "^3.0.4", "@vue/compiler-sfc": "^3.0.4"
problem:
\ 正在编译...[@vue/compiler-sfc] compileScript now requires passing the `id` option.
Upgrade your vite or vue-loader version for compatibility with the latest experimental proposals.
- 正在编译...[@vue/compiler-sfc] compileTemplate now requires the `id` option.`.
how to solve this problem?
What is expected?
What is actually happening?
no this tips.
Same issue with rollup out of the box. Config info below:
"dependencies": {
"vue": "^3.0.0"
},
"devDependencies": {
"@types/jest": "^24.0.19",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/compiler-sfc": "^3.0.4",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^5.0.2",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^7.0.0-0",
"prettier": "^1.19.1",
"rollup": "^2.35.1",
"rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-vue": "^6.0.0-beta.10",
"typescript": "~3.9.3",
"vue-jest": "^5.0.0-0"
}
and rollup config:
import vue from "rollup-plugin-vue";
import typescript from "rollup-plugin-typescript";
export default {
input: "src/components/MyComponent.vue",
output: {
format: "esm",
file: "dist/MyComponent.js"
},
external: ["vue"],
plugins: [
vue({ optimizeSSR: true }),
typescript({
tsconfig: false,
experimentalDecorators: true,
module: "es2015"
})
]
};
@mazaiting - I've resolved this issue by setting the NODE_ENV
.
NODE_ENV=production npx rollup -c
- For example removes this error.
@mazaiting - I've resolved this issue by setting the
NODE_ENV
.
NODE_ENV=production npx rollup -c
- For example removes this error.
I think setting NODE_ENV
is not a good solution, because this problem still occurs during the development process.
Read and follow https://new-issue.vuejs.org/?repo=vuejs/vue#why-repro The error might be a miss configuration on a template. In that case open the issue on the template repo
Read and follow https://new-issue.vuejs.org/?repo=vuejs/vue#why-repro The error might be a miss configuration on a template. In that case open the issue on the template repo
I think the question template I asked is compliant. Please point out where is the problem?