Skip to content

Version 2.14.1 generates common.js inside of dist/_nuxt/node_modules #7901

Closed
@lance-anderson

Description

@lance-anderson

Versions

  • nuxt: v2.14.1
  • node: v12.18.3

Steps to reproduce

  1. Upgrade a Nuxt project to latest 2.14.1
  2. Run yarn generate

What is Expected?

In v2.14.0, the "commons" javascript file was generated in dist/_nuxt/commons/

image

What is actually happening?

In v2.14.1, the "commons" javascript file is generated in dist/_nuxt/node_modules/

image

The Problem

Generating the commons file inside of node_modules conflicts with Nuxt's default .gitignore rules which includes: node_modules. This is problematic when deploying a static site relies on committing the dist folder to a git repo. The end result is a deployed site that is missing the commons file.

Resolution

This can be resolved by changing the .gitignore rule from: node_modules to /node_modules. Alternatively, it can be resolve by downgrading to Nuxt v2.14.0. Perhaps it would be ideal if the commons file wasn't placed inside of a folder named "node_modules".

Activity

pkpowell

pkpowell commented on Aug 13, 2020

@pkpowell

Changing .gitignore doesn't help if you're deploying to netlify via cli. netlify deploy ignores all node_module dirs

hojas

hojas commented on Aug 13, 2020

@hojas

+1 same issue

mehtaanshul

mehtaanshul commented on Aug 13, 2020

@mehtaanshul

I found the issue, can i pick this @pi0 ?

pi0

pi0 commented on Aug 13, 2020

@pi0
Member

Hi. parent directories (.nuxt and dist) are also already gitignored. Would you please point to an example netlify deployment (logs and or url) which this issue is happening?

pkpowell

pkpowell commented on Aug 13, 2020

@pkpowell

I inquired about this on the netlify forum.
I got this reply from fool, Director of Support

It’s not a gitignore, it’s an intentional ignoring benefitting people who (would) accidentally deploy tens of thousands of files in node_modules and slow down their deployment by many minutes while we upload all those accidental files.
I think this is not your situation - you’re doing it with intention, and with a smaller installation, but there is no workaround for the behavior. Our system (when uploading from our CI) optimizes those away for you. Can you use a different pathname than literally node_modules to hold the files?

pi0

pi0 commented on Aug 13, 2020

@pi0
Member

@pkpowell Super thanks for clarification with support 👍 Seems no way other than changing back to vendors 🙅

kendalled

kendalled commented on Aug 14, 2020

@kendalled

@pi0 Can you expand on this? Currently facing this same issue and is messing up my builds.

kendalled

kendalled commented on Aug 14, 2020

@kendalled

Or at least when is this getting fixed?

reopened this on Aug 14, 2020

6 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @pkpowell@lance-anderson@hojas@pi0@mehtaanshul

      Issue actions

        Version 2.14.1 generates common.js inside of dist/_nuxt/node_modules · Issue #7901 · nuxt/nuxt