forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy invalid-resolve-alias as it is being linked in the codebase
- Loading branch information
1 parent
18abc98
commit bb2ae41
Showing
1 changed file
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Invalid webpack resolve alias | ||
|
||
#### Why This Error Occurred | ||
|
||
When overriding `config.resolve.alias` incorrectly in `next.config.js` webpack will throw an error because private-next-pages is not defined. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
This is not a bug in Next.js, it's related to the user adding a custom webpack(config) config to next.config.js and overriding internals by not applying Next.js' aliases. Solution would be: | ||
|
||
```js | ||
webpack(config) { | ||
config.resolve.alias = { | ||
...config.resolve.alias, | ||
// your aliases | ||
} | ||
} | ||
``` | ||
|
||
### Useful Links | ||
|
||
- [Related issue](https://github.com/zeit/next.js/issues/6681) |