nuxt
nuxt copied to clipboard
tsconfig.js moduleResolution Node16 or NodeNext
Versions
- nuxt: @nuxt/cli v2.15.8
- node: v16.14.0
Reproduction
See steps to reproduce...
Additional Details
export default { // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode ssr: false,
// Global page headers: https://go.nuxtjs.dev/config-head head: { title: 'yyy', htmlAttrs: { lang: 'en', }, meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' }, ], link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], },
// Global CSS: https://go.nuxtjs.dev/config-css css: ['@/assets/css/common.css'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins plugins: ['~/plugins/route'],
// Auto import components: https://go.nuxtjs.dev/config-components components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules buildModules: [ // https://go.nuxtjs.dev/typescript ['@nuxt/typescript-build'], ],
// Modules: https://go.nuxtjs.dev/config-modules modules: [ // https://go.nuxtjs.dev/bootstrap 'bootstrap-vue/nuxt', // https://go.nuxtjs.dev/axios '@nuxtjs/axios', ],
// Axios module configuration: https://go.nuxtjs.dev/config-axios axios: { // Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308 baseURL: '/', },
// Build Configuration: https://go.nuxtjs.dev/config-build build: {}, serverMiddleware: [{ path: '/api', handler: '~/api/api.ts' }], }
Steps to reproduce
- yarn create nuxt-app yyy
- choose typescript support
- yarn install
-
tsconfig.json
changemoduleResolution
toNode16
- run yarn dev
What is Expected?
No errors
What is actually happening?
ERROR Failed to compile with 2 errors friendly-errors 14:02:39
ERROR in C:\Users\xxx\GitHub\nuxt2\tsconfig.json friendly-errors 14:02:39
friendly-errors 14:02:39
TS6046: Argument for '--moduleResolution' option must be: 'node', 'classic'.
friendly-errors 14:02:39
@ ./pages/index.vue?vue&type=script&lang=ts& 1:0-216 1:232-235 1:237-450 1:237-450
@ ./pages/index.vue
@ ./.nuxt/router.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
friendly-errors 14:02:39
ERROR in ./pages/index.vue?vue&type=script&lang=ts& friendly-errors 14:02:39
Module build failed (from ./node_modules/ts-loader/index.js): friendly-errors 14:02:39
Error: error while parsing tsconfig.json
at Object.loader (C:\Users\xxx\GitHub\nuxt2\node_modules\ts-loader\dist\index.js:18:18)
friendly-errors 14:02:39
@ ./pages/index.vue?vue&type=script&lang=ts& 1:0-216 1:232-235 1:237-450 1:237-450
@ ./pages/index.vue
@ ./.nuxt/router.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js