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

'The "path" argument must be of type string' since 4.0.0-rc.1 #363

Closed
ara4n opened this issue Sep 26, 2018 · 10 comments
Closed

'The "path" argument must be of type string' since 4.0.0-rc.1 #363

ara4n opened this issue Sep 26, 2018 · 10 comments

Comments

@ara4n
Copy link

ara4n commented Sep 26, 2018

  • Operating System: macOS 10.14
  • Node Version: v10.9.0
  • NPM Version: 6.4.1
  • webpack Version: 4.20.2
  • karma-webpack Version: 4.0.0-rc.2 and rc.1

Actual Behavior

Karma crashes out shortly after launch with:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at assertPath (path.js:39:11)
    at Object.join (path.js:1157:7)
    at Plugin.<anonymous> (/Users/matthew/workspace/vector-web/node_modules/karma-webpack/lib/karma-webpack.js:286:70)
    at Plugin.readFile (/Users/matthew/workspace/vector-web/node_modules/karma-webpack/lib/karma-webpack.js:305:5)
    at process._tickCallback (internal/process/next_tick.js:61:11)

4.0.0-beta.0 is okay; but rc.1 and rc.2 exhibit the problem.

Looks like a regression in ab4dde9 which happens when stats.assetsByChunkName[entry] returns an array of assets rather than a single asset. Then when calculating the tmp filename to be read, path.join() crashes out because it's trying to concatenate an array rather than a string.

In this instance (https://github.com/vector-im/riot-web/tree/matthew/webpack4) it's because the test/all-tests.js entryPath has two assets: bundles/d918c3aa7df7ca65ad57/test/all-tests.js and bundles/d918c3aa7df7ca65ad57/test/all-tests.css.

@wilkie
Copy link

wilkie commented Oct 3, 2018

I've even gotten something like this where it gave that error in 3.0.5 (but tells me it "Received type undefined") but not when I downgraded to 3.0.0 (which is the version I'm using on a different project) where it all works just fine.

From my own very rudimentary debugging... there is some kind of "outputs" array that isn't generated properly (and not used at all in 3.0.0) and I'm not sure why.

@bluepnume
Copy link

Any traction on this one? I'm attempting to upgrade to webpack 4 and having problems getting karma working with karma-webpack rc.2

@Ivaylo-Lafchiev
Copy link

I am also having the same problem. Everything after [email protected] doesn't work because of the above error (or variations of it), with either [email protected] or karma@latest.

@thijstriemstra
Copy link

see #361

@matthieu-foucault
Copy link
Collaborator

Fixed in #361 and released.
Use npm i -D karma-webpack@next to update.

@chrisnicola
Copy link

I still see this intermittently on rc.6.

@johnny-mh
Copy link

@matthieu-foucault I still see this issue on rc.6

@matthieu-foucault
Copy link
Collaborator

Sorry but my focus isn't on this project at the moment, and likely won't be in the future. You'll have to find someone else willing to maintain it.

@Ivaylo-Lafchiev
Copy link

Sorry but my focus isn't on this project at the moment, and likely won't be in the future. You'll have to find someone else willing to maintain it.

What does this mean for the future of Karma? Should we be moving to something like Jest?

@matthieu-foucault
Copy link
Collaborator

matthieu-foucault commented Mar 23, 2019 via email

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

8 participants