-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Wired type errors when using TypeScript + <slot> + SSR #1070
Comments
I made the reproduction minimal, now the only files in
<template>
<Layout>
Hello world!
</Layout>
</template>
<script setup lang="ts">
import Layout from '../Shared/Layout.vue'
</script>
<template>
<slot />
</template> And the full error messages are:
|
Please help! |
I found the errors only occurs when mix
...
.webpackConfig({
target: "node",
externals: [webpackNodeExternals()],
}) |
My current solution is
I consider this issue closed. |
Hei @xieyuheng, this mean you stop using TS on app? I'm facing similar problem with SSR and TS. Do you could use SSR with TS? |
Hi @henryavila Sorry for late reply. I use ts in my app, just not in vue files. For examples:
Here is my {
"compilerOptions": {
"target": "es6",
"module": "esnext",
"strict": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"useDefineForClassFields": true,
"baseUrl": ".",
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["resources/js"]
} Here is my const mix = require("laravel-mix")
mix
.js("resources/js/app.js", "public/js")
.extract()
.vue({ version: 3 })
.css("resources/css/app.css", "public/css", [require("tailwindcss")])
.webpackConfig({
module: {
rules: [
{
test: /\.ts$/,
use: [{ loader: "ignore-loader" }],
},
],
},
})
.version()
if (!mix.inProduction()) {
mix.sourceMaps()
} Here is my const mix = require("laravel-mix")
const webpackNodeExternals = require("webpack-node-externals")
mix
.options({ manifest: false })
.js("resources/js/ssr.js", "public/js/ssr/index.js")
.vue({
version: 3,
extractStyles: "css/ssr/ignored.css",
options: { optimizeSSR: true },
})
.webpackConfig({
target: "node",
externals: [webpackNodeExternals()],
module: {
rules: [{ test: /\.ts$/, use: [{ loader: "ignore-loader" }] }],
},
}) |
Hey @xieyuheng Can set ts-loader options webpack.ssr.mix.js mix
.options({ manifest: false })
.ts('resources/js/ssr.ts', 'public/js', { transpileOnly: true }) // add `transpileOnly` option
.vue({ version: 3, options: { optimizeSSR: true } })
.webpackConfig({
...webpackConfig,
target: 'node',
externals: [webpackNodeExternals()],
}) see: https://github.com/TypeStrong/ts-loader#transpileonly |
Versions:
@inertiajs/inertia
version: 0.11.0@inertiajs/inertia-vue3
version: 0.6.0Describe the problem:
Wired type errors when using TypeScript + + SSR.
Steps to reproduce:
I forked
pingcrm
and made a single commit to reproduce the problem.resources/js/Shared/Layout.vue
.Please see this commit for changed files: https://github.com/xieyuheng/pingcrm/commit/fecd31f551ee528a7ce905905de3e2728ff19119
Errors
The text was updated successfully, but these errors were encountered: