Skip to content

Commit

Permalink
Fix windows paths for invalid import errors (#45999)
Browse files Browse the repository at this point in the history
Check for windows paths for the `server-only` and `client-only` build errors.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
  • Loading branch information
hanneslund authored Feb 16, 2023
1 parent 5599c47 commit 2f96ae5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ export default async function getBaseWebpackConfig(
]
: []),
{
test: /node_modules\/client-only\/error.js/,
test: /node_modules[/\\]client-only[/\\]error.js/,
loader: 'next-invalid-import-error-loader',
issuerLayer: WEBPACK_LAYERS.server,
options: {
Expand All @@ -2005,7 +2005,7 @@ export default async function getBaseWebpackConfig(
},
},
{
test: /node_modules\/server-only\/index.js/,
test: /node_modules[/\\]server-only[/\\]index.js/,
loader: 'next-invalid-import-error-loader',
issuerLayer: WEBPACK_LAYERS.client,
options: {
Expand Down

0 comments on commit 2f96ae5

Please sign in to comment.