druxt.js icon indicating copy to clipboard operation
druxt.js copied to clipboard

require() of ES Module

Open dubbs opened this issue 2 years ago • 1 comments

Describe the bug After installing the druxt-site module and running the Nuxt dev server, the following error occurs:

require() of ES Module /node_modules/axios/index.js from /node_modules/vue-server-renderer/build.dev.js not supported. Instead change the require of index.js in /node_modules/vue-server-renderer/build.dev.js to a dynamic import() which is available in all CommonJS modules.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://druxtjs.org/modules/site/getting-started
  2. Follow Nuxt installation instructions
  3. Start the Nuxt dev server
  4. See error

Your Environment (please complete the following information):

  • OS: macOS Ventura 13.2
  • Browser: Chrome
  • Version: 114

Additional context As a temporary fix, add this to your nuxt.config.js:

build: {
  transpile: [
    'axios'
  ]
}

dubbs avatar Jul 19 '23 03:07 dubbs

Thanks for bringing this issue and solution to my attention. I will look further into this in an upcoming sprint.

Decipher avatar Jul 25 '23 01:07 Decipher