Nuxt.js: Symlinked node_modules are compiled with Babel

Created on 20 Apr 2018  路  4Comments  路  Source: nuxt/nuxt.js

Version

v1.4.0

Reproduction link

https://github.com/antoinerey/vue-component

Steps to reproduce

  1. Clone the component https://github.com/antoinerey/vue-component
  2. Clone the app https://github.com/antoinerey/vue-component-app
  3. Link the component cd vue-component && npm link
  4. Fetch the linked component from the app cd vue-component-app && npm link vue-component
  5. Start the application npm run dev

What is expected ?

The build should pass without any warning and the app should run.

What is actually happening?

The build emits some warning about the default export not being found. And the application crashes.

Additional comments?

I'm trying to develop and publish a component to NPM. While testing it, I wanted to ensure it was working into a Nuxt application.


Note that if I install the exact same package from NPM, it works as expected. So I'm thinking this issue is related to symlinks and how Babel transformations are applied.

This bug report is available on Nuxt.js community (#c6947)
bug-report

Most helpful comment

I've had the same issue, solved it by setting config.resolve.symlinks = false in the nuxt.config.js

// extend webpack config
extend(config, { isDev, isClient }) {
  // do not resolve symlinks
  if (isDev) config.resolve.symlinks = false
})

All 4 comments

I've had the same issue, solved it by setting config.resolve.symlinks = false in the nuxt.config.js

// extend webpack config
extend(config, { isDev, isClient }) {
  // do not resolve symlinks
  if (isDev) config.resolve.symlinks = false
})

Thanks! Spent a lot of time for debug this.

I had try just import module in nuxt page in es6-style from a local module in node_modules dir:

import { wordToNum, numToWord } from 'webpack-numbers'

and got errors that export is not defined

This bug-report has been cancelled by @manniL.

Solution as explained by @sh

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uptownhr picture uptownhr  路  3Comments

bimohxh picture bimohxh  路  3Comments

mikekidder picture mikekidder  路  3Comments

gary149 picture gary149  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments