Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack 4.19.1: undefinedresolvePathname is not defined (but 4.19.0 works!) #8052

Closed
sorenhoyer opened this issue Sep 19, 2018 · 13 comments
Closed

Comments

@sorenhoyer
Copy link

sorenhoyer commented Sep 19, 2018

Bug report

What is the current behavior?

The first time we npx start our project after a fresh npm install it seems to work. Subsequent attempt fail with a blank page and the following error (no compiler errors):

image

This started right after 4.19.1 was published yesterday, as soon as people did an npm install.

If the current behavior is a bug, please provide the steps to reproduce.

In our project we see this bug on all computers, and the fix is the same. To explicitly npm install webpack@4.19.0 after the npm install script concludes.

What is the expected behavior?

npx start should always start up the website (not just the first time after a fresh npm install) and not result in a blank page + the error in the screenshot above. .

Other relevant information:
webpack version: 4.19.1
Node.js version: 8.11.4
Operating System: Windows 10 Pro 64 Bit
Additional tools:

"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-hot-middleware": "^2.22.2",
"webpack-merge": "^4.1.3"

@ooflorent
Copy link
Member

Thanks for your report. It would be great if you reduce your issue to a small reproducible example. Best put this example into a github repository together with instructions how to get to the problem.

@shincysl
Copy link

Not sure if this is the same issue. We use hard-source plugin. The first time, webpack compiles successfully. But when run webpack again, there are syntax errors in the emitted code. The problem code looks like "undefinedfunction".
There are no changes in hard-source plugin. We just updated webpack from 4.19.0 to 4.19.1.

@mape
Copy link

mape commented Sep 20, 2018

I'm having the same issue as @shincysl when using the hard-source plugin after updating from 4.19.0 to 4.19.1. I tried creating a barebone project to reproduce the issue but for whatever reason it doesn't show the same symptoms as my main project.

@ooflorent
Copy link
Member

Could you confirm the error is gone if you remove hard-source-webpack-plugin?

@sorenhoyer
Copy link
Author

sorenhoyer commented Sep 20, 2018

Great! The common denominator seems to be hard-source-webpack-plugin - we also use that (latest version 0.12.0)! @ooflorent It does indeed seem to be working fine without it - just tested.

@sokra
Copy link
Member

sokra commented Sep 20, 2018

@mzgoddard Do you know what causes this? Maybe we can find a backward-compatible change.

@kirschre
Copy link

@ooflorent @sokra I'm running into the same issue as the users above. Little bit of extra debugging info - it seems hard-source-webpack-plugin can occasionally cause dep.prefix to be undefined here, which ends up getting directly inserted into the string output. Not sure why yet but I'll try to dig a little further.

@domoritz
Copy link

I'm getting an error Uncaught SyntaxError: Unexpected token { with this code:

/***/ "./node_modules/d3-array/src/ascending.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = (undefinedfunction(a, b) {
  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
});


/***/ }),

Yes, I am also using hard-source.

@anton164
Copy link

anton164 commented Sep 27, 2018

We're getting:

ERROR in chunk 4
4.b85a368070f1993f5b0b.js
/root/project/node_modules/recharts/es6/index.js 41315544f420ae398c27b28733ff9346
Unexpected token (1:91)
| /* harmony default export */ var __WEBPACK_MODULE_DEFAULT_EXPORT__ = (undefinedfunction(x) {
|   return function constant() {
|     return x;

and
image

with hard-source-webpack-plugin and webpack 4.20.2

@sokra
Copy link
Member

sokra commented Sep 27, 2018

There is already a PR in hard-source-webpack-plugin fixing this: mzgoddard/hard-source-webpack-plugin#444

Sorry that this is causing issues, hard-source-webpack-plugin relies on webpack internals for serialization. Internals may change in non-major version so it's a bit harder to keep in sync...

The situation will probably improve with webpack 5, which includes persistent caching in the core.

@sh4d1t0
Copy link

sh4d1t0 commented Sep 27, 2018

I reverted to 4.19.0 and not working in production enviroment, 4.17.1 neither, only develop enviroment.

So I deleted hard-source-webpack-plugin and works again

@sibelius
Copy link

sibelius commented Nov 7, 2018

it is a problem with hard-source-webpack-plugin

@sibelius
Copy link

@sokra we can close this, this happens because of an old cache when using hard-source-webpack-plugin

Eole211 added a commit to wanadev/obsidianjs-starter that referenced this issue May 14, 2019
BobRazowsky pushed a commit to BobRazowsky/eurostats that referenced this issue Oct 26, 2019
Squashed commit of the following:

commit f1d51f9
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 27 12:11:29 2019 +0200

    Revert "Merge branch 'merge-upstream' into 'master'"

    This reverts commit 461cd72, reversing
    changes made to b9ae291.

commit 461cd72
Merge: b9ae291 687f177
Author: Léo Demicheli <ldemicheli@wanadev.fr>
Date:   Mon May 27 12:06:01 2019 +0200

    Merge branch 'merge-upstream' into 'master'

    Merge upstream

    Closes #1

    See merge request obsidian/starter!17

commit 687f177
Author: Léo Demicheli <ldemicheli@wanadev.fr>
Date:   Mon May 27 12:06:01 2019 +0200

    Merge upstream

commit b9ae291
Merge: a6fe286 d86ef61
Author: Léo Demicheli <ldemicheli@wanadev.fr>
Date:   Mon May 27 11:33:19 2019 +0200

    Merge branch 'merge-upstream-2' into 'master'

    Merge upstream 2

    See merge request obsidian/starter!15

commit d86ef61
Merge: e36c1b1 8481ac3
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 27 11:31:05 2019 +0200

    Merge remote-tracking branch 'upstream/master' into merge-upstream-2

commit a6fe286
Author: Léo Demicheli <ldemicheli@wanadev.fr>
Date:   Mon May 27 10:57:22 2019 +0200

    Update README.md

commit e36c1b1
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 27 10:45:01 2019 +0200

    revert 3d changes merged in this project

commit de791fe
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 27 10:39:40 2019 +0200

    Revert "Merge branch 'materialManager' into 'master'"

    This reverts commit 222e979, reversing
    changes made to 8e1d302.

commit 8481ac3
Merge: 2c020de 918a18c
Author: Eole211 <ldemicheli@wanadev.fr>
Date:   Mon May 27 10:28:47 2019 +0200

    Merge pull request #2 from wanadev/eslint-webpack-import-resolver

    eslint webpack resolve

commit 222e979
Merge: 8e1d302 577a636
Author: Léo Demicheli <ldemicheli@wanadev.fr>
Date:   Tue May 21 16:24:34 2019 +0200

    Merge branch 'materialManager' into 'master'

    Material manager

    See merge request obsidian/starter!10

commit 577a636
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue May 21 16:13:15 2019 +0200

    es6 modules and readme update

commit ae7d36b
Merge: 9df1241 e1ec762
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:56:58 2019 +0200

    Merge branch 'materialManager' of git.wanadev.org:ldemicheli/starter into materialManager

commit 9df1241
Merge: 4aa1d90 8e1d302
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:55:09 2019 +0200

    Merge branch 'master' of git.wanadev.org:obsidian/starter into materialManager

commit 8e1d302
Merge: e652291 7008eea
Author: Léo Demicheli <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:53:06 2019 +0200

    Merge branch 'merge-upstream' into 'master'

    Merge upstream

    See merge request obsidian/starter!4

commit 7008eea
Merge: ed705bb 3031ada
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:50:27 2019 +0200

    Merge branch '3-add-plop-module-generation' into merge-upstream

commit 3031ada
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:48:29 2019 +0200

    clean

commit 6bb4ba7
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:47:08 2019 +0200

    back to wandev license

commit 4f5404c
Merge: e652291 2c020de
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:44:07 2019 +0200

    Merge branch 'master' of https://github.com/wanadev/obsidianjs-starter into 3-add-plop-module-generation

commit 4aa1d90
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:30:56 2019 +0200

    clean

commit e1ec762
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:30:56 2019 +0200

    clean

commit ca3577b
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 16:25:36 2019 +0200

    remove plop

commit f920661
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 20 15:48:04 2019 +0200

    big clean

commit 918a18c
Author: Eole211 <tagazzoc@gmail.com>
Date:   Mon May 20 14:31:55 2019 +0200

    resolve modules

commit 2c020de
Merge: 534c490 debfb09
Author: Eole211 <tagazzoc@gmail.com>
Date:   Thu May 16 14:06:45 2019 +0200

    Merge pull request #4 from wanadev/no-hard-source

    Remove hardsource webpack plugin

commit debfb09
Author: Eole211 <tagazzoc@gmail.com>
Date:   Tue May 14 15:33:44 2019 +0200

    Remove hardsource webpack plugin

    see webpack/webpack#8052

commit 557485c
Merge: 358c120 f097647
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 13 16:18:12 2019 +0200

    external material manger and main loop module

commit f097647
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Thu May 9 17:26:48 2019 +0200

    main loop as npm module, packages update

commit e4e29b6
Merge: 66fd53e 06f4291
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue May 7 11:03:41 2019 +0200

    Merge branch 'plopfile' into 'master'

    Fix folder name bug for plopfile

    See merge request ldemicheli/starter!2

commit 06f4291
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue May 7 11:02:04 2019 +0200

    Fix folder name bug for plopfile

commit 66fd53e
Merge: 218093f f8923ea
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue May 7 10:46:45 2019 +0200

    Merge branch 'plopfile' into 'master'

    Initial commit on plopfile

    See merge request ldemicheli/starter!1

commit 358c120
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon May 6 17:57:42 2019 +0200

    material switcher

commit 98fa146
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Mon May 6 15:43:42 2019 +0200

    Add debug config to material manager, add metadata to material definition
    Material library, add lots of new materials : gold, silver, copper, wood, glass, brick

commit 818f942
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 30 18:06:21 2019 +0200

    Working on material library, add brick, metal, glass material

commit 5b1779a
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Thu Apr 25 15:24:27 2019 +0200

    load materials json ok,  uuid for texUrl +param

commit 94545ee
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 23 18:13:48 2019 +0200

    Initial commit material-manager

commit f8923ea
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 16 17:45:38 2019 +0200

    Initial commit on plopfile

commit ed705bb
Merge: e652291 534c490
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 17:54:42 2019 +0200

    Merge remote-tracking branch 'upstream/master' into merge-upstream

commit 218093f
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 17:22:35 2019 +0200

    doc

commit 615f888
Merge: 2542046 534c490
Author: Eole211 <tagazzoc@gmail.com>
Date:   Tue Apr 9 17:20:53 2019 +0200

    Merge branch 'master' into eslint-webpack-import-resolver

commit cb81c19
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 9 16:53:49 2019 +0200

    WIP

commit e3fba70
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 15:55:41 2019 +0200

    show torus color and rotation

commit f3ad214
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 15:09:32 2019 +0200

    working data nbinding

commit 630c08b
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 15:06:32 2019 +0200

    vue wip

commit bf52073
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 14:17:34 2019 +0200

    refacto module name

commit 3f0b241
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 13:54:50 2019 +0200

    ready event

commit d3d1f89
Merge: 9e9774d 62e6cbd
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 9 10:53:22 2019 +0200

    Merge branch 'master' of git.wanadev.org:ldemicheli/starter

commit 9e9774d
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 9 10:51:27 2019 +0200

    rename menu to main menu, css width for canvas, add canvas container

commit 62e6cbd
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 9 10:33:46 2019 +0200

    fix vue components

commit 53d4d79
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon Apr 8 18:23:29 2019 +0200

    vue wip

commit 485f992
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Mon Apr 8 10:43:00 2019 +0200

    no enum anymore

commit 6b1b5c4
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Wed Apr 3 15:13:09 2019 +0200

    clean

commit bf7b424
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Tue Apr 2 19:07:19 2019 +0200

    new fps count

commit 1679f4a
Author: Timotée Neullas <tneullas@wanadev.fr>
Date:   Tue Apr 2 17:49:33 2019 +0200

    First commit on mainloop

commit 534c490
Merge: df5d0e1 2d29f7c
Author: Fabien LOISON <flozz@users.noreply.github.com>
Date:   Mon Mar 11 15:47:00 2019 +0100

    Merge pull request #3 from CraigFeldspar/master

    Updating license to BSD

commit 2d29f7c
Author: Benjamin Guignabert <benjamin.guignabert@gmail.com>
Date:   Mon Mar 11 15:36:38 2019 +0100

    Update LICENSE

commit 85f6122
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Wed Jan 30 17:03:41 2019 +0100

    lights in an object

commit 4ea6856
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Wed Jan 30 16:56:03 2019 +0100

    update project name

commit 24bf022
Author: ldemicheli@wanadev.fr <ldemicheli@wanadev.fr>
Date:   Wed Jan 30 15:58:01 2019 +0100

    Babylon Engine module

commit e652291
Merge: dbd0de3 df5d0e1
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Tue Jan 29 12:06:48 2019 +0100

    Merge remote-tracking branch 'upstream/master'

commit df5d0e1
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Tue Jan 29 12:04:46 2019 +0100

    Update integration example

commit dbd0de3
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Tue Jan 29 11:25:23 2019 +0100

    Add link to Google Cloud deployment guide in README

commit 49a6e79
Merge: e467875 92fc776
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Tue Jan 29 11:22:21 2019 +0100

    Merge remote-tracking branch 'upstream/master'

commit 92fc776
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Tue Jan 29 11:21:32 2019 +0100

    Update node version from 6 to 8 in Dockerfile

commit e467875
Merge: 1ee859f 07acb2a
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Wed Jan 23 17:27:34 2019 +0100

    Merge remote-tracking branch 'upstream/master'

commit 07acb2a
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Wed Jan 23 17:26:53 2019 +0100

    Replace uglifyjs with terser

commit 1ee859f
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Wed Jan 23 11:42:08 2019 +0100

    Fix integration example for caas

commit 955ebf5
Merge: 88b51c2 f4098ed
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Wed Jan 23 11:36:33 2019 +0100

    Merge remote-tracking branch 'upstream/master'

commit f4098ed
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Wed Jan 23 11:35:32 2019 +0100

    Fix integration example, update dependencies

commit 88b51c2
Merge: 713ee1e 42f8b8e
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Mon Jan 21 18:04:41 2019 +0100

    Merge remote-tracking branch 'upstream/master'

commit 42f8b8e
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Mon Jan 21 16:44:35 2019 +0100

    Update integration example dependencies

commit c711b96
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Mon Dec 17 11:45:01 2018 +0100

    Fix compression webpack plugin parameter name

commit d1ba2aa
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Mon Dec 17 11:15:28 2018 +0100

    Add babel polyfill

commit 5e68115
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Mon Dec 17 11:09:09 2018 +0100

    Update dependencies

commit c248fbc
Author: Valentin Ledrapier <vledrapier@wanadev.fr>
Date:   Mon Dec 17 11:07:02 2018 +0100

    Update dependencies

commit 2542046
Author: ldemicheli <ldemicheli@wanadev.fr>
Date:   Thu Sep 13 11:19:57 2018 +0200

    eslint webpack resolve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests