Giter VIP home page Giter VIP logo

vite's Introduction

DEPRECATED

This module is now part of the Nuxt Bridge. Please report issues to the nuxt/framework repo instead.


Vite Experience with Nuxt 2. GitHub.com/nuxt/vite

🧪 Vite mode is experimental and many Nuxt modules are still incompatible. If you find a bug, please report via issues with a minimal reproduction.

💡 We are trying to make most modules and options work out-of-the-box. If you are a module maintainer, please see this section for supporting Vite. If a module or feature is missing, feel free to open an issue.

⚡ Quick Start

Install nuxt-vite: (nuxt >= 2.15.0 is required)

yarn add --dev nuxt-vite
# OR
npm i -D nuxt-vite

Add to buildModules:

// nuxt.config
export default {
  buildModules: [
    'nuxt-vite'
  ]
}

That's it! Now you can enjoy a super fast nuxt dev experience with Vite!

📖 Read documentation for more

❤️ Credits

This module could not be possible without vite-plugin-vue2 by @underfin

Published under MIT License

vite's People

Contributors

antfu avatar atinux avatar bibekstha avatar danielroe avatar daniluk4000 avatar drslump avatar jochemvogel avatar madsh93 avatar michaeljolley avatar pi0 avatar renovate[bot] avatar reslear avatar ronvoluted avatar tahul avatar vinayakkulkarni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vite's Issues

Bug: sass conflict with vue loader (Support @nuxtjs/style-resources - middleware/store)

Version

nuxt-vite: v0.0.7
nuxt: v2.14.12

Configuration

export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'nuxt21-vite',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
  ],

  // 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',
    'nuxt-vite'
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
  ],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
  },
  telemetry: false,
}

Reproduction

Here is reproduction repo: using create nuxt-app cli

https://github.com/sondh0127/nuxt21-vite

Description

<style lang="scss" scoped>
.nuxt-error {
  padding: 0;
}
</style>

I'm using sass in SFC, by following the Vite docs here
https://vitejs.dev/guide/features.html#css-pre-processors

yarn add sass

But Vite could not resolve the loader from importing .vue components
image

Aliases added by module are not supported.

Thank you for this module and opportunity to use vite in our daily projects.
I noticed one issue: Aliases added by module are not supported.

Versions

nuxt-vite: [email protected]
nuxt: [email protected]

Reproduction

Reproduction repository:
module: https://github.com/mercs600/nuxt-vite-module-aliases/tree/master/modules/aliasModule
import: https://github.com/mercs600/nuxt-vite-module-aliases/blob/master/pages/index.vue#L11

Description

When I want to extend application aliases by my module - then I get errors:

 ERROR  [vite]: Rollup failed to resolve import "~aliasModule/moduleComponent" from "pages/index.vue".                                                 16:07:09
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

Module function:

export default function (moduleOptions) {
  this.extendBuild((config, { isDev, isClient }) => {
    config.resolve.alias['~aliasModule'] = resolve(__dirname)
  })
}

When I added alias to nuxt.config then it works.
https://github.com/mercs600/nuxt-vite-module-aliases/blob/master/nuxt.config.js#L38

nuxt-i18n support (lazy)

Versions

nuxt-vite: 0.0.20
nuxt: 2.15.2

Reproduction

I tried to make it in codesandbox, but it might work differently because there's no issue.

Description

Uncaught SyntaxError: import not found: klona            plugin.main.js:39:9

Something like: nuxt-modules/i18n#1004

Tried to remove node_modules and .nuxt, add klona into my dependencies and peerDependencies, even tried the alias. Nothing worked.

It's being imported like

import { klona } from '/@fs/home/foxie/Code/project/node_modules/klona/full/index.js'

Why is there the /@fs prepended?

Provide ability to pass configuration to vite-plugin-vue2

Is your feature request related to a problem? Please describe.

For example, to get vite-plugin-md working, we need to pass options to Vue 2's plugin to let it aware of .md files as Vue components.

createVuePlugin({
  include: [/\.vue$/, /\.md$/]
})

Describe the solution you'd like

Add an entry or hook for passing options to vite-plugin-vue2, createVuePlugin(optionsHere)

Describe alternatives you've considered

Additional context

Cannot find module 'ufo/dist/index.js'

Version

nuxt-vite: v0.0.8
nuxt: v2.14.12

Configuration

  // Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
  ssr: true,
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: 'su',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: ['~/assets/css/tailwind.scss'],
  server: {
    host: '0.0.0.0',
    port: process.env.NODE_ENV === 'production' ? '4010' : '3333',
  },
  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    '~/plugins/filters.js',
    '~/plugins/v-tooltip.js',
    '~/plugins/axios.js',
    { src: '~/plugins/vue-form-wizard.js' },
    { src: '~/plugins/vue-js-toggle-button.js', ssr: false },
    { src: '~/plugins/lottie-animation.js' },
    { src: '~/plugins/v-emoji-picker.js' },
    { src: '~/plugins/vee-validate.js', ssr: false },
    { src: '~/plugins/i18n.js' },
  ],

  // 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',
    // https://go.nuxtjs.dev/tailwindcss
    '@nuxtjs/tailwindcss',
    'nuxt-ackee',
    'nuxt-vite',
  ],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    // https://go.nuxtjs.dev/pwa
    '@nuxtjs/pwa',
    // https://go.nuxtjs.dev/content
    // '@nuxt/content',
    '@nuxtjs/auth-next',
    '@nuxtjs/toast',
    '@nuxtjs/proxy',
    [
      'nuxt-i18n',
      {
        lazy: true,
        loadLanguagesAsync: true,
        locales: [
          {
            code: 'en',
            name: 'English',
            iso: 'en-US',
            file: 'en.js',
          },
        ],
        langDir: 'locales/',
        defaultLocale: 'en',
        fallbackLocale: 'en',
        strategy: 'prefix',
        detectBrowserLanguage: {
          useCookie: true,
          cookieKey: 'i18n_redirected',
        },
      },
    ],
    'vue-swatches/nuxt',
  ],
  // Content module configuration (https://go.nuxtjs.dev/config-content)
  content: {},

  axios: {
    proxy: process.env.GENERAL_PROXY || false,
  },


  auth: {
    plugins: ['~/plugins/auth.js'],
    strategies: {
      local: {
        token: {
          property: 'accessToken',
          type: 'Bearer',
        },
        user: {
          property: 'user',
          autoFetch: true,
        },
        endpoints: {
          login: {
            url: '/auth/signin',
            method: 'post',
          },
          logout: {
            url: '/auth/logout',
            method: 'post',
          },
          user: {
            url: '/user/me',
            method: 'get',
          },
        },
      },
    },
  },



  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {},
}

Description

 Cannot find module 'ufo/dist/index.js'                                                           13:57:39
Require stack:
- /project-new/node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js
- /project-new/node_modules/nuxt-vite/dist/nuxt-vite.js
- /project-new/node_modules/@nuxt/core/dist/core.js
- /project-new/node_modules/@nuxt/cli/dist/cli-index.js
- /project-new/node_modules/@nuxt/cli/dist/cli.js
- /project-new/node_modules/@nuxt/typescript-runtime/bin/nuxt-ts.js

Failed to resolve entry for package "tty"

I've tried adding nuxt/vite to an existing project but am getting the below error when running nuxt dev. I've tried stripping my project down to the bare minimum but still get the error, so I'm not sure what exactly it could be related to. I don't reference the tty node package anywhere in my own code.

> node_modules/vite/dist/node/chunks/dep-00e79b84.js:34318:14: error: [vite:dep-pre-bundle] Failed to resolve entry for package "tty". The package may have incorrect main/module/exports specified in its package.json.
    34318 │         throw new Error(`Failed to resolve entry for package "${id}". ` +
          ╵               ^
    at resolvePackageEntry (/Users/stuff/frontend/node_modules/vite/dist/node/chunks/dep-00e79b84.js:34318:15)
    at tryNodeResolve (/Users/stuff/frontend/node_modules/vite/dist/node/chunks/dep-00e79b84.js:34158:11)

   node_modules/vite/dist/node/chunks/dep-00e79b84.js:67463:18: note: This error came from the "onResolve" callback registered here
    67463 │             build.onResolve({ filter: /^[\w@][^:]/ }, async ({ path: id, importer }) => {
          ╵                   ~~~~~~~~~
    at setup (/Users/stuff/frontend/node_modules/vite/dist/node/chunks/dep-00e79b84.js:67463:19)
    at handlePlugins (/Users/stuff/frontend/node_modules/esbuild/lib/main.js:670:7)


 ERROR  1:34:58 PM [vite] error while updating dependencies:                                                                                                                                                                                             13:34:58
Error: Build failed with 1 error:
node_modules/vite/dist/node/chunks/dep-00e79b84.js:34318:14: error: [vite:dep-pre-bundle] Failed to resolve entry for package "tty". The package may have incorrect main/module/exports specified in its package.json.
    at failureErrorWithLog (/Users/stuff/frontend/node_modules/esbuild/lib/main.js:1171:15)
    at buildResponseToResult (/Users/stuff/frontend/node_modules/esbuild/lib/main.js:907:32)
    at /Users/stuff/frontend/node_modules/esbuild/lib/main.js:1002:20
    at /Users/stuff/frontend/node_modules/esbuild/lib/main.js:553:9
    at handleIncomingPacket (/Users/stuff/frontend/node_modules/esbuild/lib/main.js:642:9)
    at Socket.readFromStdout (/Users/stuff/frontend/node_modules/esbuild/lib/main.js:520:7)
    at Socket.emit (events.js:223:5)
    at Socket.EventEmitter.emit (domain.js:475:20)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:181:23)

nuxt/vite version: 0.0.6
nuxt version: 2.15.2

Support alias and plugins

 ERROR  Client compiled with errors: The following dependencies are imported but could not be resolved:

  nuxt_plugin_plugin_1aac32db (imported by /my/repo/.nuxt/index.js)
  nuxt_plugin_pluginclient_8259ce52 (imported by /my/repo/.nuxt/index.js)
  nuxt_plugin_pluginserver_248c8a5f (imported by /my/repo/.nuxt/index.js)
  nuxt_plugin_plugin_720efac8 (imported by /my/repo/.nuxt/index.js)
  nuxt_plugin_pluginserver_722e082b (imported by /my/repo/.nuxt/index.js)
  nuxt_plugin_pluginclient_0c7496a3 (imported by /my/repo/.nuxt/index.js)
  nuxt_plugin_meta_3875608a (imported by /my/repo/.nuxt/index.js)

broken when using nuxt/components together

Fix test/fixture/nuxt.config.js

$ git diff test
diff --git a/test/fixture/nuxt.config.js b/test/fixture/nuxt.config.js
index f2d6f7e..af76cca 100644
--- a/test/fixture/nuxt.config.js
+++ b/test/fixture/nuxt.config.js
@@ -1,5 +1,6 @@
 import viteModule from '../../src'
 export default {
+  components: true,
   buildModules: [
     viteModule
   ],

I got an error.

$ /Users/odan/source/github.com/nuxt/vite/node_modules/.bin/jest
  console.info
    Discovered Components: test/fixture/.nuxt/0o1wutbk/components/readme.md

      at node_modules/@nuxt/components/dist/index.js:230:13


 RUNS  test/index.test.ts
 > test/fixture/.nuxt/0o1wutbk/index.js:15:7: error: No matching export for import "default"
    15 │ import nuxt_plugin_plugin_d00e1886 from 'nuxt_plugin_plugin_d00e1886' // Source: ./components/plugin.js (mode: 'all')
       ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~

 > test/fixture/.nuxt/0o1wutbk/index.js:15:7: error: No matching export for import "default"
    15 │ import nuxt_plugin_plugin_d00e1886 from 'nuxt_plugin_plugin_d00e1886' // Source: ./components/plugin.js (mode: 'all')
[error] Client compiled with errors: Build failed with 1 error:
test/fixture/.nuxt/0o1wutbk/index.js:15:7: error: No matching export for import "default"
  test/fixture/.nuxt/0o1wutbk/index.js:15:7: error: No matching export for import "default"
  at failureErrorWithLog (node_modules/esbuild/lib/main.js:1171:15)
  at buildResponseToResult (node_modules/esbuild/lib/main.js:907:32)
  at node_modules/esbuild/lib/main.js:1002:20
  at node_modules/esbuild/lib/main.js:553:9
  at handleIncomingPacket (node_modules/esbuild/lib/main.js:642:9)
  at Socket.readFromStdout (node_modules/esbuild/lib/main.js:520:7)
  at Socket.emit (node:events:376:20)
  at addChunk (node:internal/streams/readable:305:12)
  at readableAddChunk (node:internal/streams/readable:280:9)
  at Socket.Readable.push (node:internal/streams/readable:219:10)
  at Pipe.onStreamRead (node:internal/stream_base_commons:192:23)
[error] Server compiled with errors: Build failed with 1 error:
test/fixture/.nuxt/0o1wutbk/index.js:15:7: error: No matching export for import "default"
  test/fixture/.nuxt/0o1wutbk/index.js:15:7: error: No matching export for import "default"
  at failureErrorWithLog (node_modules/esbuild/lib/main.js:1171:15)
  at buildResponseToResult (node_modules/esbuild/lib/main.js:907:32)
  at node_modules/esbuild/lib/main.js:1002:20
  at node_modules/esbuild/lib/main.js:553:9
  at handleIncomingPacket (node_modules/esbuild/lib/main.js:642:9)
  at Socket.readFromStdout (node_modules/esbuild/lib/main.js:520:7)
  at Socket.emit (node:events:376:20)
  at addChunk (node:internal/streams/readable:305:12)
  at readableAddChunk (node:internal/streams/readable:280:9)
  at Socket.Readable.push (node:internal/streams/readable:219:10)
  at Pipe.onStreamRead (node:internal/stream_base_commons:192:23)

branch: 6a3bd49

`kebab-case` middleware file triggers build error

Versions

nuxt-vite: 0.0.12
nuxt: 2.15.2

Reproduction

Reproduction repository
https://github.com/tuanna-hsp/nuxt-vite-issue

Description

Can not start nuxt-vite app with kebab-case middleware files.

ℹ Preparing project for development                                                                                                                                                          00:25:45
ℹ Initial build may take a while                                                                                                                                                             00:25:45
ℹ Discovered Components: .nuxt/components/readme.md                                                                                                                                          00:25:45
✔ Builder initialized                                                                                                                                                                        00:25:45
✔ Nuxt files generated                                                                                                                                                                       00:25:45
✔ Client compiled successfully in 0.015s                                                                                                                                                     00:25:45
 > .nuxt/middleware.js:1:13: error: Expected "from" but found "-"
    1 │ import $kebab-case-middleware from '../middleware/kebab-case-middleware.js'
      ╵              ^


 ERROR  Server compiled with errors: Build failed with 1 error:                                                                                                                              00:25:46
.nuxt/middleware.js:1:13: error: Expected "from" but found "-"

  .nuxt/middleware.js:1:13: error: Expected "from" but found "-"
  at failureErrorWithLog (node_modules/esbuild/lib/main.js:1177:15)
  at buildResponseToResult (node_modules/esbuild/lib/main.js:913:32)
  at node_modules/esbuild/lib/main.js:1008:20
  at node_modules/esbuild/lib/main.js:559:9
  at handleIncomingPacket (node_modules/esbuild/lib/main.js:648:9)
  at Socket.readFromStdout (node_modules/esbuild/lib/main.js:526:7)
  at Socket.emit (events.js:315:20)
  at addChunk (_stream_readable.js:300:12)
  at readableAddChunk (_stream_readable.js:276:9)
  at Socket.Readable.push (_stream_readable.js:217:10)
  at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

SyntaxError: import not found: default

Versions

nuxt-vite: 0.0.21
nuxt: 2.15.2

Reproduction

https://github.com/thefoxie/nuxt-vite-imports-issue

Description

As mentioned already (#59 (comment)), there's issue with imports.

Imported modules/exports in sfc don't work which makes the component not to render when used with components option set to true. The component renders when the import is commented out. I tried to import the component straight and had SyntaxError: import not found: default, but the component renders at least.

When components option set to true:

[Vue warn]: Failed to resolve async component: () => import('/@fs/home/foxie/Dokumenty/Code/OSS/nuxt-vite-imports-issue/components/NanoId.vue').then(c => c.default || c)
Reason: SyntaxError: import not found: default

Cannot find module

Version

nuxt-vite: v0.0.7
nuxt: v2.14.12 -->

Configuration

  // Disable server-side rendering (https://go.nuxtjs.dev/ssr-mode)
  ssr: true,
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: 'su',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: ['~/assets/css/tailwind.scss'],
  server: {
    host: '0.0.0.0',
    port: process.env.NODE_ENV === 'production' ? '4010' : '3333',
  },
  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    '~/plugins/filters.js',
    '~/plugins/v-tooltip.js',
    '~/plugins/axios.js',
    { src: '~/plugins/vue-form-wizard.js' },
    { src: '~/plugins/vue-js-toggle-button.js', ssr: false },
    { src: '~/plugins/lottie-animation.js' },
    { src: '~/plugins/v-emoji-picker.js' },
    { src: '~/plugins/vee-validate.js', ssr: false },
    { src: '~/plugins/i18n.js' },
  ],

  // 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',
    // https://go.nuxtjs.dev/tailwindcss
    '@nuxtjs/tailwindcss',
    'nuxt-ackee',
    'nuxt-vite',
  ],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
    // https://go.nuxtjs.dev/pwa
    '@nuxtjs/pwa',
    // https://go.nuxtjs.dev/content
    // '@nuxt/content',
    '@nuxtjs/auth-next',
    '@nuxtjs/toast',
    '@nuxtjs/proxy',
    [
      'nuxt-i18n',
      {
        lazy: true,
        loadLanguagesAsync: true,
        locales: [
          {
            code: 'en',
            name: 'English',
            iso: 'en-US',
            file: 'en.js',
          },
        ],
        langDir: 'locales/',
        defaultLocale: 'en',
        fallbackLocale: 'en',
        strategy: 'prefix',
        detectBrowserLanguage: {
          useCookie: true,
          cookieKey: 'i18n_redirected',
        },
      },
    ],
    'vue-swatches/nuxt',
  ],
  // Content module configuration (https://go.nuxtjs.dev/config-content)
  content: {},

  axios: {
    proxy: process.env.GENERAL_PROXY || false,
  },


  auth: {
    plugins: ['~/plugins/auth.js'],
    strategies: {
      local: {
        token: {
          property: 'accessToken',
          type: 'Bearer',
        },
        user: {
          property: 'user',
          autoFetch: true,
        },
        endpoints: {
          login: {
            url: '/auth/signin',
            method: 'post',
          },
          logout: {
            url: '/auth/logout',
            method: 'post',
          },
          user: {
            url: '/user/me',
            method: 'get',
          },
        },
      },
    },
  },



  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {},
}

Description

Screen Shot 2021-02-26 at 17 06 10

and terminal

 ERROR  ENOENT: no such file or directory, rmdir '/project/node_modules/.vite/temp'                                            17:01:10

  at Proxy.rmdirSync (fs.js:890:10)
  at scanImports (node_modules/vite/dist/node/chunks/dep-00e79b84.js:46058:17)
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
  at doBuild (node_modules/vite/dist/node/chunks/dep-00e79b84.js:46427:41)
  at Object.build (node_modules/vite/dist/node/chunks/dep-00e79b84.js:46379:16)
  at FSWatcher.<anonymous> (node_modules/nuxt-vite/dist/nuxt-vite.js-vite.js:164:5)

[plugin:vite:css] Preprocessor dependency "sass" not found. Did you install it?

[plugin:vite:css] Preprocessor dependency "sass" not found. Did you install it?
/my-proje/assets/css/tailwind.scss
    at loadPreprocessor (/my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:18188:15)
    at scss (/my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:18193:20)
    at compileCSS (/my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:17965:40)
    at TransformContext.transform (/my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:17653:50)
    at Object.transform (/my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:45957:30)
    at transformRequest (/my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:61528:29)
    at /my-proje/node_modules/vite/dist/node/chunks/dep-00e79b84.js:61630:32
Click outside or fix the code to dismiss.
You can also disable this overlay with hmr: { overlay: false } in vite.config.js.

Hola 👋

Versions

nuxt-vite:
nuxt:

Reproduction

Description

support page middleware

Error in browser dev tools console:

Uncaught ReferenceError: require is not defined at middleware.js:3

middleware.js in dev tools Sources tab:

const middleware = {}

middleware['admin'] = require('../middleware/admin.js')
middleware['admin'] = middleware['admin'].default || middleware['admin']

...

export default middleware

Issue with mapbox-gl-js pkg & vite ?

 > error: Two output files share the same path but have different contents: node_modules/.vite/mapbox-gl.js.map

 > error: Two output files share the same path but have different contents: node_modules/.vite/mapbox-gl.js


 ERROR  Client compiled with errors: Build failed with 2 errors:                                                                                                                                                                                    19:22:46
error: Two output files share the same path but have different contents: node_modules/.vite/mapbox-gl.js.map
error: Two output files share the same path but have different contents: node_modules/.vite/mapbox-gl.js

Uncaught SyntaxError: The requested module ... does not provide an export named 'default'

Affected dependencies:

  • ufo
  • date-fns
  • nanoid

Vite's dep-optimization, generates an entry like this for client:

import __vite__cjsImport1_ufo from "/@fs/..../node_modules/.cache/vite/client/ufo.js?v=5294cbe1";
const _isSamePath = __vite__cjsImport1_ufo["isSamePath"];

But since dependencies like ufo use named esm exports (export { ... }), it generates an error like this:

Uncaught SyntaxError: The requested module ... does not provide an export named 'default'

Current workaround, is to either use alias option to resolve such deps to CJS version or exclude them via optimizeDeps.exclude:

// nuxt.config
export default {
  vite: {
    optimizeDeps: {
      exclude: [
        'date-fns'
      ]
    }
  }
}

Other variant (#62): SyntaxError: import not found: default

Dependencies cannot be resolved (js-cookie, lozad, vuelidate, @sentry/browser, axios)

ERROR Client compiled with errors: The following dependencies are imported but could not be resolved:

js-cookie (imported by /data/ofi-common-vuejs/utils/TrackingUtils.js)
lozad (imported by /data/ofi-common-vuejs/components/LazyBackground.vue)
vuelidate (imported by /data/ofi-common-vuejs/mixins/form.js)
@sentry/browser (imported by /data/ofi-common-vuejs/services/CommonService.js)
axios (imported by /data/ofi-common-vuejs/services/HttpFirebaseService.js)

Versions

nuxt-vite: 0.0.21
nuxt: 2.15.2
js-cookie : 2.2.1
lozad: 1.16.0
vuelidate : 0.7.6
@nuxtjs/sentry : 5.0.0
axios : 0.21.1

Description

When I launch the start command, these plugins cannot be resolved...

Examples of code :
import Cookie from 'js-cookie';
import lozad from 'lozad';
import { validationMixin } from 'vuelidate';
import { captureException } from '@sentry/browser';
import axios from 'axios';

fix: support asset importing (ssr)

template:

<img src="../assets/logo.svg">
 ERROR  [vite]: Rollup failed to resolve import "assets/logo.svg" from "pages/index.vue?vue&type=template&lang.js".                                                                     22:44:25
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`


 ERROR  Server compiled with errors: [vite]: Rollup failed to resolve import "assets/logo.svg" from "pages/index.vue?vue&type=template&lang.js".                                        22:44:25
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

Unexpected "<" when jsx render tag

Versions

nuxt-vite: 0.0.22
nuxt: 2.15.2

e.g.

import AnchoredHeading from './AnchoredHeading.vue'

new Vue({
  el: '#demo',
  render: function (h) {
    return (
      <AnchoredHeading level={1}>
        <span>Hello</span> world!
      </AnchoredHeading>
    )
  }
})

Description

error: Unexpected "<"

Nuxt date-fns support

Versions

nuxt-vite: 0.0.18
nuxt: 2.15.2

Reproduction

https://github.com/pushpak1300/pushpak1300.github.io

Description

The client and server is getting compiled when I run npm run dev
But showing an error in the console
Uncaught SyntaxError: The requested module '/@fs/home/pushpak1300/Desktop/projects/javascript/pushpak1300.github.io/node_modules/.cache/vite/client/date-fns.js?v=25441ce8' does not provide an export named 'default'

Apart from this everything is working as expected
Output for build

   ╭───────────────────────────────────────────────────────╮
   │                                                       │
   │   Nuxt @ v2.15.2                                      │
   │                                                       │
   │   ▸ Environment: development                          │
   │   ▸ Rendering:   client-side                          │
   │   ▸ Target:      static                               │
   │                                                       │
   │   Listening: http://localhost:3000/                   │
   │                                                       │
   │   ⚡  Vite Mode Enabled (v0.0.18)                     │
   │   Tailwind Viewer: http://localhost:3000/_tailwind/   │
   │                                                       │
   ╰───────────────────────────────────────────────────────╯

ℹ Preparing project for development                                                                                                         11:03:28
ℹ Initial build may take a while                                                                                                            11:03:28
ℹ Discovered Components: .nuxt/components/readme.md                                                                                         11:03:28
✔ Builder initialized                                                                                                                       11:03:28
✔ Nuxt files generated                                                                                                                      11:03:29
✔ Client compiled successfully in 0.036s                                                                                                    11:03:29
✔ Server compiled successfully in 0.048s                                                                                                    11:03:29
ℹ Waiting for file changes                                                                                                                  11:03:29
ℹ Memory usage: 89.9 MB (RSS: 190 MB)                                                                                                       11:03:29
ℹ Listening on: http://localhost:3000/      

config.resolve.alias doesn't work

✔ Builder initialized
✔ Nuxt files generated

html:/data/ofi/components/common/Footer/FooterNewsletter.vue:2:22: error: Could not resolve "oficommonvuejs/components/Share/BtnSocial.vue" (the plugin "vite:dep-scan" didn't set a resolve directory)

Versions

nuxt-vite: 0.0.21
nuxt: 2.15.2

Description

I've this config in nuxt.config for an alias repository on build but there is no resolution of it :
build: {
extend(config, { isDev }) {
config.resolve.alias.oficommonvuejs = path.resolve(__dirname, '../ofi-common-vuejs');
}
}

Error in /node_modules/.vite/servyer and The requested module '/content/query-builder.js' does not provide an export named 'default'

Versions

nuxt-vite: v0.0.12
nuxt: v2.15.2

Reproduction

https://github.com/eazybike/website

Description

yarn dev show an error:
ENOENT: no such file or directory, rmdir '/Users/filippo/Development/nuxt-vite/node_modules/.vite/servyer/temp/temp

Client and server compiled sucessfully

In console on localhost:3000
Uncaught SyntaxError: The requested module '/content/query-builder.js' does not provide an export named 'default'

Invalid component name: "ForgotPasswordPage$1"

Versions

nuxt-vite: v0.0.18
nuxt: v2.15.2

Description



 ERROR  [Vue warn]: Invalid component name: "Status$2". Component names should conform to valid custom element name in html5 specification.           10:02:53


 ERROR  [Vue warn]: Invalid component name: "Status$1". Component names should conform to valid custom element name in html5 specification.           10:02:53


 ERROR  [Vue warn]: Invalid component name: "ListCreatePage$1". Component names should conform to valid custom element name in html5 specification.   10:02:53


Not possible to disable HMR

Versions

nuxt-vite: 0.0.28
nuxt: 2.15.2

Description

There's ws call even when there's hmr:false. This makes it hard to deploy behind reverse proxy with redirects. Tried everything (setting port and path, proxy, etc) and it didn't work for me. It would be better to turn it off completely.
nuxt.config.js

 vite: {
        server: {
            hmr: false,
        },
    },

No matching export for import "default"

Server compiled with errors: Build failed with 1 error:                                                                                                         04:20:57
.nuxt/index.js:16:7: error: No matching export for import "default"

  .nuxt/index.js:16:7: error: No matching export for import "default"
  at failureErrorWithLog (node_modules/esbuild/lib/main.js:1171:15)
  at buildResponseToResult (node_modules/esbuild/lib/main.js:907:32)
  at node_modules/esbuild/lib/main.js:1002:20
  at node_modules/esbuild/lib/main.js:553:9
  at handleIncomingPacket (node_modules/esbuild/lib/main.js:642:9)
  at Socket.readFromStdout (node_modules/esbuild/lib/main.js:520:7)
  at Socket.emit (events.js:315:20)
  at addChunk (_stream_readable.js:309:12)
  at readableAddChunk (_stream_readable.js:284:9)
  at Socket.Readable.push (_stream_readable.js:223:10)
  at Pipe.onStreamRead (internal/stream_base_commons.js:188:23

| Nuxt @ v2.15.2 │
│ │
│ ▸ Environment: development │
│ ▸ Rendering: server-side │
│ ▸ Target: static |

nuxt-vite fails to compile if 'store' directory is absent

If you use a minimal repo and the store directory is missing for whatever reason, nuxt-vite will throw an error when running yarn dev. It works fine if you create the store directory and add an index.js to it.

Perhaps the solution is that there just needs a way for nuxt+vite to function without a Vuex store being present?

 ERROR  Could not compile template /home/vitetest/node_modules/nuxt-vite/templates/store.js: storeModules is not defined                    09:02:01

  at node_modules/@nuxt/builder/dist/builder.js:723:17
  at async Promise.all (index 0)
  at async Builder.compileTemplates (node_modules/@nuxt/builder/dist/builder.js:701:5)
  at async Builder.generateRoutesAndFiles (node_modules/@nuxt/builder/dist/builder.js:388:5)
  at async Builder.build (node_modules/@nuxt/builder/dist/builder.js:319:5)
  at async Object._buildDev (node_modules/@nuxt/cli/dist/cli-dev.js:107:5)
  at async Object.startDev (node_modules/@nuxt/cli/dist/cli-dev.js:65:7)
  at async Object.run (node_modules/@nuxt/cli/dist/cli-dev.js:52:5)
  at async NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:413:7)

Versions

nuxt-vite: 0.0.9
nuxt: 2.15.2

Reproduction

https://github.com/nathanchase/vitetest

Support `vite:extend` hook

Support vite to extend default config and adding plugins.... Also probably adding new hook like vite:extendConfig to extend configuration by other modules

typescript broken with plugin

Version

nuxt-vite: 0.0.8
nuxt: 2.15.2

Configuration

buildModules: [
    [
      'nuxt-vite',
      '@nuxt/typescript-build',
      {
        typeCheck: {
          typescript: {
            memoryLimit: 8000,
            extensions: {
              vue: true,
            },
          },
        },
      },
    ],
    'nuxt-typed-vuex',
  ],

Description

The error happens in file where I import @nuxt/types like import { Plugin } from '@nuxt/types';

Nuxt Vite is unable to load/compile gql file

Version

nuxt-vite: v0.0.7
nuxt: v2.15.2

Description

Without Nuxt Vite module, I was able to import a graphql file to my vue component. The moment I added Nuxt Vite, the gql was unable to load/compiled.

file: files.gql

ERROR Server compiled with errors: Unexpected token (1:6) 20:30:42

at Object.pp$4.raise (node_modules\rollup\dist\shared\rollup.js:15857:13)
at Object.pp.unexpected (node_modules\rollup\dist\shared\rollup.js:13549:8)
at Object.pp.semicolon (node_modules\rollup\dist\shared\rollup.js:13526:64)
at Object.pp$1.parseExpressionStatement (node_modules\rollup\dist\shared\rollup.js:14005:8)
at Object.pp$1.parseStatement (node_modules\rollup\dist\shared\rollup.js:13740:24)
at Object.pp$1.parseTopLevel (node_modules\rollup\dist\shared\rollup.js:13606:21)
at Object.parse (node_modules\rollup\dist\shared\rollup.js:13408:15)
at Function.parse (node_modules\rollup\dist\shared\rollup.js:13429:35)
at Object.Graph.contextParse [as parse] (node_modules\rollup\dist\shared\rollup.js:19134:70)
at Object.transform (node_modules\vite\dist\node\chunks\dep-1bdbec90.js:33778:27)
at Object. (node_modules\vite\dist\node\chunks\dep-1bdbec90.js:46726:33)
at node_modules\rollup\dist\shared\rollup.js:19049:25

Replacing `document` with `undefined` cause undefined error on client

Versions

nuxt-vite: 0.0.28
nuxt: 2.15.2

Reproduction

Start the codesandbox and look to console
https://codesandbox.io/s/inspiring-kowalevski-gzy97?file=/nuxt.config.js

Description

Replacing document with undefined cause an undefined issue on script injection.

document: 'undefined',

Modules like color-mode and google-fonts are adding scripts info head and Vite replaces document in these scripts and finally it raises undefined error on browser

Nuxt vite failed to write output file

hi all . i just installed fresh nuxt and add nuxt vite but i got error like below .

ERROR Client compiled with errors: The following dependencies are imported but could not be resolved: 06:05:17

nuxt_plugin_plugin_4ccce809 (imported by C:/Users/sabana-code/documents/programing/vitenuxt/.nuxt/index.js)
nuxt_plugin_plugin_4885f88b (imported by C:/Users/sabana-code/documents/programing/vitenuxt/.nuxt/index.js)

nuxt_plugin_plugin_4ccce809 (imported by C:/Users/sabana-code/documents/programing/vitenuxt/.nuxt/index.js)
nuxt_plugin_plugin_4885f88b (imported by C:/Users/sabana-code/documents/programing/vitenuxt/.nuxt/index.js)

error: Failed to write to output file: open C:\Users\pimp\documents\programing\vitenuxt\node_modules.vite\temp\server.js: The system cannot find the path specified.

Nuxt CompositionAPI Support

An error occerred with using composition API together.

  ERROR  Client compiled with errors: Build failed with 39 errors:                                  11:42:15
node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
...

  node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
  node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
  node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
  node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
  node_modules/vite/dist/node/chunks/dep-00e79b84.js:33860:7: error: [vite:dep-scan] No known conditions for "." entry in "@nuxtjs/composition-api" package
  ...
  at failureErrorWithLog (node_modules/esbuild/lib/main.js:1171:15)
  at buildResponseToResult (node_modules/esbuild/lib/main.js:907:32)
  at node_modules/esbuild/lib/main.js:1002:20
  at node_modules/esbuild/lib/main.js:553:9
  at handleIncomingPacket (node_modules/esbuild/lib/main.js:642:9)
  at Socket.readFromStdout (node_modules/esbuild/lib/main.js:520:7)
  at Socket.emit (events.js:315:20)
  at Socket.EventEmitter.emit (domain.js:483:12)
  at addChunk (_stream_readable.js:295:12)
  at readableAddChunk (_stream_readable.js:271:9)
  at Socket.Readable.push (_stream_readable.js:212:10)
  at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

Can't find loader handling '.vue' files

Version

nuxt-vite: v0.0.7
nuxt: v2.14.0

Configuration

import { getBaseUrl } from './utils/utils';

// eslint-disable-next-line nuxt/no-cjs-in-config
module.exports = {
	ssr: true,
	target: 'server',
	},
	loading: '~/components/Loading.vue',
	/*
	 ** Global CSS
	 */
	css: ['@/assets/style/base/reset.scss', '@/assets/style/base/utils.scss'],
	styleResources: {
		scss: [
			'@/assets/style/base/color.scss',
			'@/assets/style/base/variables.scss',
			'@/assets/style/base/mixins.scss',
		],
	},
	/*
	 ** Plugins to load before mounting the App
	 ** https://nuxtjs.org/guide/plugins
	 */
	plugins: [
		'~/plugins/datadog',
		{ src: '~/plugins/node-winston-logger', mode: 'server' },
		{ src: '~/plugins/custom-logger' },
		{ src: '~plugins/ga', mode: 'client' },
		{ src: '~plugins/vue-awesome-swiper', mode: 'client' },
		'~/plugins/amplitude',
		'~/plugins/gtm',
		'~/plugins/validate/index',
		'~/plugins/directives/click_outside',
		'~/plugins/directives/scroll',
		'~/plugins/filters/formatNumber',
		'~/plugins/axios',
		'~/plugins/comento-ui',
		{ src: '~/plugins/toast', mode: 'client' },
		{ src: '~/plugins/quill', mode: 'client' },
		'~/mixins/gtmMixin',
		'~/mixins/windowMixin',
		'~/mixins/commonMixin',
		'~/mixins/localStorageIdMixin',
		'~/api/api',
	],
	components: true,
	buildModules: [
		'@nuxtjs/dotenv',
		'nuxt-vite',
	],
	vue: {
		config: {
			productionTip: false,
			devtools: true,
		},
	},
	polyfill: {
		features: [
			/*
          Feature without detect:

          Note:
            This is not recommended for most polyfills
            because the polyfill will always be loaded, parsed and executed.
      */
			{
				require: 'url-polyfill', // NPM package or require path of file
			},

			/*
          Feature with detect:

          Detection is better because the polyfill will not be
          loaded, parsed and executed if it's not necessary.
      */
			{
				require: 'intersection-observer',
				detect: () => 'IntersectionObserver' in window,
			},

			/*
          Feature with detect & install:

          Some polyfills require a installation step
          Hence you could supply a install function which accepts the require result
      */
			{
				require: 'smoothscroll-polyfill',

				// Detection found in source: https://github.com/iamdustan/smoothscroll/blob/master/src/smoothscroll.js
				detect: () =>
					'scrollBehavior' in document.documentElement.style && window.__forceSmoothScrollPolyfill__ !== true,

				// Optional install function called client side after the package is required:
				install: smoothscroll => smoothscroll.polyfill(),
			},
		],
	},
	modules: [
		'@nuxtjs/gtm',
		'@nuxtjs/axios',
		'nuxt-polyfill',
		'@nuxtjs/style-resources',
		'cookie-universal-nuxt',
		'@nuxtjs/svg',
		'vue-scrollto/nuxt',
	],
	axios: {
		// 모듈 설정
		baseURL: getBaseUrl(),
		headers: {
			common: {
				Accept: 'application/vnd.comento.v1+json',
			},
		},
		credentials: true,
		// axios 자동디버깅용
		debug: true,
	},
	/*
	 ** Build configuration
	 ** See https://nuxtjs.org/api/configuration-build/
	 */
	build: {
		transpile: ['vee-validate/dist/rules', 'vue-svg-loader', 'swiper', 'dom7'],
		babel: {
			presets({ envName }) {
				const envTargets = {
					client: { browsers: ['last 2 versions'], ie: 11 },
					server: { node: 'current' },
				};
				return [
					[
						'@nuxt/babel-preset-app',
						{
							targets: envTargets[envName],
							// buildTarget: envName,
							corejs: { version: 3 },
							// debug: true,
							// usage 옵션은 코드를 분석하여, 필요한 폴리필을 자동 제공
							useBuiltIns: 'usage',
						},
					],
				];
			},
		},
		extend(config, { isDev, isClient }) {
			config.node = {
				fs: 'empty',
			};
			if (isClient) {
				config.devtool = isDev ? 'inline-source-map' : 'cheap-module-source-map';
			}
			// Run ESLint on save
			if (isDev && isClient) {
				config.module.rules.push({
					enforce: 'pre',
					test: /\.(js|vue)$/,
					loader: 'eslint-loader',
					exclude: /(node_modules)/,
				});
			}

			const pngRule = config.module.rules.find(({ test }) => test.test('.png'));
			pngRule.test = /\.(jpe?g|gif|webp)$/;
			config.module.rules.push({
				test: /\.(png|jpe?g|gif|webp)$/,
				use: {
					loader: 'file-loader',
					options: {
						name: 'assets/[name].[contenthash].[ext]',
						outputPath: 'img',
						esModule: false,
					},
				},
			});
		},
	},
	router: {
		base: '/',
		middleware: ['route-guard', 'route-meta'],
	},
	env: {
		baseUrl: getBaseUrl(),
		NODE_ENV: process.env.NODE_ENV,
	},
};

Reproduction

Description

If I use '@' in the path, it can't find proper loader dealing with '.vue' file.
I need to replace the absolute path with the relative path. Is there anyway to keep my webpack config?
image

Uncaught ReferenceError: exports is not defined at Index.js

Versions

nuxt-vite: 0.0.28
nuxt: 2.15.2

Reproduction

https://github.com/pushpak1300/pushpak1300.github.io

Description

The client and server is getting compiled when I run npm run dev
But showing an error in the console
Uncaught ReferenceError: exports is not defined at Index.js

Apart from this everything is working as expected
Output for build

 ℹ Using Tailwind CSS from ~/assets/css/tailwind.css             nuxt:tailwindcss 22:03:08
ℹ Merging Tailwind config from ~/tailwind.config.js             nuxt:tailwindcss 22:03:08
ℹ Parsed 10 files in 0,7 seconds                                   @nuxt/content 22:03:10

   ╭───────────────────────────────────────────────────────╮
   │                                                       │
   │   Nuxt @ v2.15.2                                      │
   │                                                       │
   │   ▸ Environment: development                          │
   │   ▸ Rendering:   client-side                          │
   │   ▸ Target:      static                               │
   │                                                       │
   │   Listening: http://localhost:3000/                   │
   │                                                       │
   │   ⚡  Vite Mode Enabled (v0.0.28)                     │
   │   Tailwind Viewer: http://localhost:3000/_tailwind/   │
   │                                                       │
   ╰───────────────────────────────────────────────────────╯

ℹ Preparing project for development                                              22:03:11
ℹ Initial build may take a while                                                 22:03:11
ℹ Discovered Components: .nuxt/components/readme.md                              22:03:12
✔ Builder initialized                                                            22:03:12
✔ Nuxt files generated                                                           22:03:12
✔ Server compiled successfully in 0.39s                                          22:03:14
✔ Client compiled successfully in 0.694s                                         22:03:14
ℹ Waiting for file changes                                                       22:03:22
ℹ Memory usage: 187 MB (RSS: 281 MB)                                             22:03:22
ℹ Listening on: http://localhost:3000/        

JSX transform support

Current JSX support, requires to specify h argument:

export default {
  render (h) {
    return <div>JSXComponent</div>
  }
}

We shall use a transform to remove this need. Current jsx option of vite-plugin-vue2 breaks plugin/typescript support, lacks hmr and uses babel which is costly (compared to

Nuxt content support

Using nuxt/content together will result in an error.

 ERROR  'default' is not exported by .nuxt/content/query-builder.js, imported by .nuxt/content/plugin.client.js


 ERROR  file: /Users/odan/source/github.com/odan-sandbox/nuxt-vite-with-content-bug/.nuxt/content/plugin.client.js:3:7


 ERROR  1: import Vue from 'vue'                                                    08:10:55
2: import NuxtContent from './nuxt-content.dev'
3: import QueryBuilder from './query-builder'
          ^
4: 
5: Vue.component(NuxtContent.name, NuxtContent)


 ERROR  Server compiled with errors: 'default' is not exported by .nuxt/content/query-builder.js, imported by .nuxt/content/plugin.client.js

  at error (node_modules/rollup/dist/shared/rollup.js:5275:30)
  at Module.error (node_modules/rollup/dist/shared/rollup.js:9992:16)
  at Module.traceVariable (node_modules/rollup/dist/shared/rollup.js:10385:29)
  at ModuleScope.findVariable (node_modules/rollup/dist/shared/rollup.js:8843:39)
  at ReturnValueScope.findVariable (node_modules/rollup/dist/shared/rollup.js:2637:38)
  at ChildScope.findVariable (node_modules/rollup/dist/shared/rollup.js:2637:38)
  at FunctionScope.findVariable (node_modules/rollup/dist/shared/rollup.js:2637:38)
  at ChildScope.findVariable (node_modules/rollup/dist/shared/rollup.js:2637:38)
  at Identifier$1.bind (node_modules/rollup/dist/shared/rollup.js:4013:40)
  at NewExpression$1.bind (node_modules/rollup/dist/shared/rollup.js:2724:23)
  at NewExpression$1.bind (node_modules/rollup/dist/shared/rollup.js:8100:15)
  at ReturnStatement$1.bind (node_modules/rollup/dist/shared/rollup.js:2724:23)
  at BlockStatement$1.bind (node_modules/rollup/dist/shared/rollup.js:2720:31)
  at FunctionExpression.bind (node_modules/rollup/dist/shared/rollup.js:2724:23)
  at VariableDeclarator.bind (node_modules/rollup/dist/shared/rollup.js:2724:23)
  at VariableDeclaration.bind (node_modules/rollup/dist/shared/rollup.js:2720:31)

Reproduction repository is here: https://github.com/odan-sandbox/nuxt-vite-with-content-bug

support styleResources

Versions

nuxt-vite: v0.0.28
nuxt: v2.15.2

Reproduction

https://github.com/daniluk4000/nuxt-vite-bug

Description

Problem was... Solved in #29, but actually not. Config is available in repo above.

Global SCSS import broken using style resources. Problem is caused by nuxt-vite, because if you remove it in nuxt.config.ts it works.

 ERROR  [vite:css] Undefined mixin.                                                                                                                                                                                                                            21:23:47
   ╷
67 │   @include mixin();
   │   ^^^^^^^^^^^^^^^^
   ╵
  layouts\default.vue 67:3  root stylesheet

<!--

Versions

nuxt-vite: 0.0.22
nuxt: 2.15.2

e.g.

import AnchoredHeading from './AnchoredHeading.vue'

new Vue({
  el: '#demo',
  render: function (h) {
    return (
      <AnchoredHeading level={1}>
        <span>Hello</span> world!
      </AnchoredHeading>
    )
  }
})

Description

error: Unexpected "<"

Publicación original de @Xiamer en #63

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.