-
Notifications
You must be signed in to change notification settings - Fork 578
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
Bug: Nuxt3+ts项目 打包报错 #1258
Comments
遇到一样的问题 |
nitro: { |
是的,排除后,打包部署到服务器无法运行。没找到办法,你解决了吗 |
q: 1950735817 |
同一个问题 |
两种办法。 第一种:让ali-oss参与构建过程,这样就能将ts编译成js。 export default defineNuxtConfig({
build: {
transpile: ['ali-oss']
}
}) 第二种,使用CDN export default defineNuxtConfig({
app: {
head: {
script: [
{ src: "http://gosspublic.alicdn.com/aliyun-oss-sdk-6.18.1.min.js" }
]
},
}) |
我在 Windows 系统上构建时出现相同的错误,但在 docker 容器内构建却是正常的,原因未知,可能与 Windows 路径有关。 FROM node:latest AS builder
WORKDIR /root
RUN npm config set registry https://registry.npmmirror.com
RUN npm install -g pnpm
COPY .npmrc .
COPY package.json .
RUN pnpm install --prod
COPY . .
RUN pnpm build
FROM node:latest
WORKDIR /root
COPY --from=builder /root/.output .
CMD node ./server/index.mjs |
Nuxt3 +ts 项目,导入ali-oss,一旦执行
pnpm run build
,就会出现打包错误。https://github.com/nuxt/nuxt/issues/19017
*.ts
文件无法解析The text was updated successfully, but these errors were encountered: