Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Continue fix + test for "Cannot read property 'startsWith' of undefined" #82

Merged

Conversation

weaverryan
Copy link
Contributor

Fixes #79 & fixes #69

This builds on top of #80 - using the fix from that commit (with credit to the original author) + adding a test, as requested by @christophehurpeau.

We've gotten a report on symfony/weback-encore#445 of this exact issue. We would love to have it fixed - the error is really hard to debug.

Cheers!

@@ -22,8 +23,7 @@ it('Sets the appropiate message', () => {
expect(moduleNotFound(error).message).toEqual(message);
});

it('Sets the appropiate message', () => {
const message = 'Module not found redux';
it('Sets the appropiate type', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test actually tests the type, not the message and the message variables was unused. Just a little cleanup.

name: 'ModuleNotFoundError',
message: 'Module not found : redux',
webpackError: {
dependencies: [ new RequireContextDependency('redux') ],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the really nice details in #79

@flaushi
Copy link

flaushi commented Nov 22, 2018

Hi,
I am facing the same error. Would be grateful for a timely release! Thanks in advance

@christophehurpeau christophehurpeau merged commit 956ecc1 into geowarin:master Dec 7, 2018
@haoqunjiang
Copy link

@timneutkens @christophehurpeau
May I ask if there is any schedule for this fix to land on npm?

@weaverryan weaverryan deleted the fix-starts-with-undefined branch January 16, 2019 15:33
@christophehurpeau
Copy link
Collaborator

@sodatea I don't have the permissions to publish a release on npm, maybe @timneutkens does ?

@shareef1989
Copy link

@timneutkens
could you?

haoqunjiang added a commit to vuejs/vue-cli that referenced this pull request Jan 29, 2019
Since the original package haven't got a new release on npm
for 10 months

geowarin/friendly-errors-webpack-plugin#82 (comment)

fixes #2244
fixes #3003
@nelson6e65
Copy link

A workaround in the meantime?

@estimtrack
Copy link

Hi!
I have been stuck with this error for 2 hours. I have realized that I was including a .png with a require and that require was not pointing to anything... I fixed the require making it point to the right path and the error dissappeared.
Hope this helps someone :)

@haoqunjiang
Copy link

FYI I've forked and published this package as https://www.npmjs.com/package/@soda/friendly-errors-webpack-plugin

AlMcKinlay pushed a commit to YMK/McDash that referenced this pull request Feb 15, 2019
This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| @​vue/cli-plugin-babel | devDependencies | minor | `3.3.0` -> `3.4.0` | [source](https://togithub.com/vuejs/vue-cli) |
| @​vue/cli-plugin-eslint | devDependencies | minor | `3.3.0` -> `3.4.0` | [source](https://togithub.com/vuejs/vue-cli) |
| @​vue/cli-service | devDependencies | minor | `3.3.1` -> `3.4.0` | [homepage](https://cli.vuejs.org/), [source](https://togithub.com/vuejs/vue-cli) |

---

### Release Notes

<details>
<summary>vuejs/vue-cli</summary>

### [`v3.4.0`](https://togithub.com/vuejs/vue-cli/blob/master/CHANGELOG.md#&#8203;340httpsgithubcomvuejsvue-clicomparev330v340-2019-01-31)

[Compare Source](https://togithub.com/vuejs/vue-cli/compare/v3.3.0...v3.4.0)

#### babel-preset-app

##### Features

-   **babel:** include es6.object.assign by default ([#&#8203;3281](https://togithub.com/vuejs/vue-cli/issues/3281)) ([8dcfc18](https://togithub.com/vuejs/vue-cli/commit/8dcfc18))
-   expose `absoluteRuntime` option, closes [#&#8203;2807](https://togithub.com/vuejs/vue-cli/issues/2807) ([d5ed280](https://togithub.com/vuejs/vue-cli/commit/d5ed280))

#### cli

##### Bug Fixes

-   fix injectImports when there's no pre-existing import declarations ([108d801](https://togithub.com/vuejs/vue-cli/commit/108d801)), closes [#&#8203;2925](https://togithub.com/vuejs/vue-cli/issues/2925)
-   should check yarn when no pacakage manager specified ([6a75056](https://togithub.com/vuejs/vue-cli/commit/6a75056)), closes [#&#8203;3393](https://togithub.com/vuejs/vue-cli/issues/3393)

#### cli-plugin-babel

##### Bug Fixes

-   add webpack to plugins' dependencies, fix yarn peer dep warnings ([6e5e117](https://togithub.com/vuejs/vue-cli/commit/6e5e117))
-   **cli-plugin-babel:** transpileDependencies should only match packages inside `node_modules`, close [#&#8203;3057](https://togithub.com/vuejs/vue-cli/issues/3057) ([#&#8203;3229](https://togithub.com/vuejs/vue-cli/issues/3229)) ([fb71653](https://togithub.com/vuejs/vue-cli/commit/fb71653))
-   take all env variables into account in `genCacheConfig` ([047872c](https://togithub.com/vuejs/vue-cli/commit/047872c)), closes [#&#8203;3275](https://togithub.com/vuejs/vue-cli/issues/3275)

#### cli-plugin-eslint

##### Bug Fixes

-   only add custom ignorePattern when no .eslintignore exists ([#&#8203;3325](https://togithub.com/vuejs/vue-cli/issues/3325)) ([febd386](https://togithub.com/vuejs/vue-cli/commit/febd386)), closes [#&#8203;3243](https://togithub.com/vuejs/vue-cli/issues/3243)

##### Features

-   add `--no-fix-warnings` option ([#&#8203;3307](https://togithub.com/vuejs/vue-cli/issues/3307)) ([2b6dba3](https://togithub.com/vuejs/vue-cli/commit/2b6dba3))

#### cli-plugin-typescript

##### Bug Fixes

-   fix linting of tsx script in .vue file ([#&#8203;3097](https://togithub.com/vuejs/vue-cli/issues/3097)) ([f3fe8b3](https://togithub.com/vuejs/vue-cli/commit/f3fe8b3))

##### Features

-   support yml, yaml and json tslint configuration files ([#&#8203;3305](https://togithub.com/vuejs/vue-cli/issues/3305)) ([596a49d](https://togithub.com/vuejs/vue-cli/commit/596a49d))

#### cli-plugin-unit-mocha

##### Bug Fixes

-   apply a workaround for the prettier / jsdom-global bug ([bca6edc](https://togithub.com/vuejs/vue-cli/commit/bca6edc))

#### cli-service

##### Bug Fixes

-   add [@&#8203;vue](https://togithub.com/vue)/component-compiler-utils to dependencies, fix yarn pnp compatibility ([3d6eab9](https://togithub.com/vuejs/vue-cli/commit/3d6eab9))
-   copy `publicPath` option to `baseUrl`, fix plugin compatibility ([27ffd28](https://togithub.com/vuejs/vue-cli/commit/27ffd28))
-   do not add link tag to demo page when css extract is false ([#&#8203;3351](https://togithub.com/vuejs/vue-cli/issues/3351)) ([9029ad1](https://togithub.com/vuejs/vue-cli/commit/9029ad1))
-   fix reference of friendly-errors-webpack-plugin in config ([486a921](https://togithub.com/vuejs/vue-cli/commit/486a921))
-   genCacheConfig return different result because linebreak ([#&#8203;3372](https://togithub.com/vuejs/vue-cli/issues/3372)) ([ab13dfe](https://togithub.com/vuejs/vue-cli/commit/ab13dfe))
-   pin webpack version, fixes [#&#8203;3335](https://togithub.com/vuejs/vue-cli/issues/3335) ([0a0a65f](https://togithub.com/vuejs/vue-cli/commit/0a0a65f))
-   should respect root `parallel` option in terser plugin ([702a2c9](https://togithub.com/vuejs/vue-cli/commit/702a2c9))
-   use a custom fork of friendly-errors-webpack-plugin ([28933c8](https://togithub.com/vuejs/vue-cli/commit/28933c8)), closes [/github.com/geowarin/friendly-errors-webpack-plugin/pull/82#issuecomment-454808535](https://togithub.com//github.com/geowarin/friendly-errors-webpack-plugin/pull/82/issues/issuecomment-454808535) [#&#8203;2244](https://togithub.com/vuejs/vue-cli/issues/2244) [#&#8203;3003](https://togithub.com/vuejs/vue-cli/issues/3003)
-   use the correct size unit (KiB) ([1553757](https://togithub.com/vuejs/vue-cli/commit/1553757)), closes [#&#8203;3283](https://togithub.com/vuejs/vue-cli/issues/3283)

##### Features

-   add typings for vue.config.js options ([#&#8203;3387](https://togithub.com/vuejs/vue-cli/issues/3387)) ([b61ea45](https://togithub.com/vuejs/vue-cli/commit/b61ea45))
-   support dart-sass as default sass implementation ([#&#8203;3321](https://togithub.com/vuejs/vue-cli/issues/3321)) ([9c1e797](https://togithub.com/vuejs/vue-cli/commit/9c1e797))
-   support use -h show detailed usage of command ([67cff95](https://togithub.com/vuejs/vue-cli/commit/67cff95))

#### cli-shared-utils

##### Bug Fixes

-   add timeout for requests ([09be0f2](https://togithub.com/vuejs/vue-cli/commit/09be0f2)), closes [#&#8203;3076](https://togithub.com/vuejs/vue-cli/issues/3076)

#### cli-ui

##### Bug Fixes

-   **cli-ui:** folder list when root windows ([#&#8203;3331](https://togithub.com/vuejs/vue-cli/issues/3331)) ([d047aca](https://togithub.com/vuejs/vue-cli/commit/d047aca))

##### Features

-   **ui:** enforce package.json npm rules ([#&#8203;3232](https://togithub.com/vuejs/vue-cli/issues/3232)) ([11d17d9](https://togithub.com/vuejs/vue-cli/commit/11d17d9))

#### eslint-config-typescript

##### Bug Fixes

-   force enable `jsx` in parserOptions, fixes [#&#8203;3268](https://togithub.com/vuejs/vue-cli/issues/3268) ([85c5973](https://togithub.com/vuejs/vue-cli/commit/85c5973))

##### Features

-   update eslint-config-typescript to use [@&#8203;typescript-eslint](https://togithub.com/typescript-eslint) ([#&#8203;3359](https://togithub.com/vuejs/vue-cli/issues/3359)) ([189ea54](https://togithub.com/vuejs/vue-cli/commit/189ea54))

</details>

---

### Renovate configuration

:date: **Schedule**: At any time (no schedule defined).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR becomes conflicted, or if you modify the PR title to begin with "`rebase!`".

:no_bell: **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#McInkay/McDash).
@phansys
Copy link

phansys commented Apr 2, 2019

@timneutkens, is there an estimated date for the release containing this fix? Thank you in advance.

@timneutkens
Copy link
Collaborator

We no longer use friendly-errors-webpack-plugin in Next.js so I'm not comfortable shipping new versions that could potentially break. I've added @christophehurpeau on the npm package as admin as he's been maintaining this project for a long time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property 'startsWith' of undefined cannot read property 'startsWith' of undefined
9 participants