next.js: Uncaught ReferenceError: dll is not defined

Bug report

The error Uncaught ReferenceError: dll_xxxxxx is not defined it happens a soon as you create a empty project and open it. Please take a look the following demo project.

It does only happening in Chrome! in FF it’s works fine.

MacOs Sierra: 10.13.6
Chrome Version: 70.0.3538.102
Node: v10.10.0
NPM: v6.4.1
  • Package dependencies:
 "@zeit/next-sass": "^1.0.2-canary.0",
    "babel-polyfill": "^6.26.0",
    "classnames": "^2.2.6",
    "cross-fetch": "^2.2.2",
    "express": "^4.16.4",
    "fs": "0.0.1-security",
    "immutable": "^3.8.2",
    "lodash": "^4.17.10",
    "next": "^7.0.2-canary.21",
    "next-redux-wrapper": "^2.0.0",
    "node-sass": "4.9.4",
    "prop-types": "^15.6.2",
    "react": "^16.4.2",
    "react-dom": "^16.4.2",
    "react-notification-system": "^0.2.17",
    "react-redux": "^5.0.7",
    "redux": "^4.0.0",
    "redux-devtools-extension": "^2.13.5",
    "redux-immutable": "^4.0.0",
    "redux-thunk": "^2.3.0"

my dev dependencies:

"devDependencies": {
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^8.2.6",
    "babel-jest": "22.4.3",
    "babel-plugin-module-resolver": "^3.1.1",
    "chai": "^4.1.2",
    "enzyme": "3.2.0",
    "enzyme-adapter-react-16": "1.5.0",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^17.0.0",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.10.0",
    "husky": "^0.14.3",
    "jest": "22.0.1",
    "lint-staged": "^7.3.0",
    "prettier-eslint": "^8.8.2",
    "react-addons-test-utils": "15.6.2",
    "react-test-renderer": "16.2.0",
    "sinon": "^6.1.5",
    "superagent": "^4.0.0-beta.5",
    "supertest": "^3.3.0"
  }

Expected behavior

Should not show any message error.

Screenshots

48650538-5f3ded80-e9d5-11e8-9125-09837a55afe7

Additional context

This bug was closed but it’s still there and I change the name of the bug in order to be more searchable.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 11
  • Comments: 32 (12 by maintainers)

Most upvoted comments

Not sure 100% how to repro what I just did to get this error to show up, but stopping my next dev process and re-installing my node dependencies before restarting next resolved for me. Seems like it could be related to not having certain dependencies next needs at runtime, or yanking them out with npm uninstall or yarn remove while next is still running the dev/webpack process.

I had it happen as a result of a pretty large refactor and haven’t been able to repro it however. I imagine most of ya’ll could fix this by rm -rf ./node_modules && npm install if I’m correct here. Could explain why @davidcraig’s case breaks only locally.

I’m having the same issue on version 9.4, and @aguilarm solution to rm -rf node_modules & yarn install did not work for me.

@lucasgerard Use &&, not single &.

If cleaning the node_modules not working and you work at localhost:3000 on multiple projects, you need to clear your browser cache/application cache/services workers.

A simple way to full clear all caches for a domain/website (Chrome dev tools):

image

Same happening to me, still not fixed on latests versions.

I just experienced it, while setting up Material UI & Co, did not have to delete my Browser Data for localhost

On Chrome Browser:

  1. Open “Dev Tools”
  2. Select the “Network” tab
  3. Check the “Disable Cache”

This will force refresh all the page assets and it should work

In my case, I stopped my server, rm -rf node_modules, npm install, and restarted my server. All was back to normal.

I believe it was caused when I “npm installed” while running the dev server, as mentioned above.

I stopped my server, running ‘npm install’ and restart the server, after it the problem disappear.

@comxd Clearing the browser data worked for me! Thanks!

It was not at all clear to me, from the error message, but in my case I had multiple next apps running in a parent now app, and the issues was assetPrefix needs to point to the subdir’s location. I tried clearing out things and re-running npm i, both at the top-level and in subdirs and it had issues. I ended up finding #257 and solved my problem in the sub-app’s next.config.js:

module.exports = {
  assetPrefix: '/store/'
}

We are experiencing the same issue. Will try to figure out what’s happening there.

Can you try latest Next.js, the dll plugin was removed

I had a similar issue in local development and running rm -rf .next/cache has resolved it.

I fixed the problem by forcing service workers to update the site, as they were caching files generating the dll is not defined error.

if ('serviceWorker' in navigator) {
   window.addEventListener('load', function() {
       navigator.serviceWorker.getRegistrations().then(registrations => {
           for(let registration of registrations) {
               registration.unregister().then(bool => {console.log('unregister: ', bool);});
               }
               window.location.reload();
       });
   });
 }

Another approach could be -as @comxd said- unregistering service workers from your browser with the Unregister service workers to force them update cached files.

So the issue could be react being shipped with a dependency you install 🤔

Can confirm the bug, reverting to v7.0.1 solves the problem for me

@PrimarchAlpharius for me it doesn’t work 😦

Can confirm the bug, reverting to v7.0.1 solves the problem for me