Skip to content

require() of ES Module #658

@dubbs

Description

@dubbs

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'
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmodule: druxtRelated to the `druxt` module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions