druxt / druxt.js

The Fully Decoupled Drupal Framework
MIT License
113 stars 21 forks source link

require() of ES Module #658

Open dubbs opened 1 year ago

dubbs commented 1 year ago

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):

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

build: {
  transpile: [
    'axios'
  ]
}
Decipher commented 1 year ago

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