Skip to content

Commit

Permalink
Merge branch 'canary' into head-manager-is-equal-node-nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed Nov 10, 2021
2 parents fdfb921 + 82c09bd commit 3effe08
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
19 changes: 18 additions & 1 deletion contributing.md
Expand Up @@ -164,7 +164,24 @@ There are two options to develop with your local version of the codebase:
yarn install --force
```

or
#### Troubleshooting

- If you see the below error while running `yarn dev` with next:

```
Failed to load SWC binary, see more info here: https://nextjs.org/docs/messages/failed-loadin
```

Try to add the below section to your `package.json`, then run again

```json
"optionalDependencies": {
"@next/swc-linux-x64-gnu": "canary",
"@next/swc-win32-x64-msvc": "canary",
"@next/swc-darwin-x64": "canary",
"@next/swc-darwin-arm64": "canary"
},
```

### Develop inside the monorepo

Expand Down
4 changes: 3 additions & 1 deletion packages/next/build/webpack-config.ts
Expand Up @@ -1337,8 +1337,10 @@ export default async function getBaseWebpackConfig(
// Makes sure `Buffer` and `process` are polyfilled in client and flight bundles (same behavior as webpack 4)
targetWeb &&
new webpack.ProvidePlugin({
// Buffer is used by getInlineScriptSource
Buffer: [require.resolve('buffer'), 'Buffer'],
process: [require.resolve('process')],
// Avoid process being overridden when in web run time
...(!isServer && { process: [require.resolve('process')] }),
}),
new webpack.DefinePlugin({
...Object.keys(process.env).reduce(
Expand Down
@@ -0,0 +1 @@
ENV_VAR_TEST="env_var_test"
@@ -1,10 +1,15 @@
import Foo from '../components/foo.client'

const envVar = process.env.ENV_VAR_TEST

export default function Index() {
return (
<div>
<h1>{`thisistheindexpage.server`}</h1>
<Foo />
<div>{envVar}</div>
<div>
<Foo />
</div>
</div>
)
}
Expand Up @@ -224,6 +224,7 @@ async function runBasicTests(context) {
)

expect(homeHTML).toContain('thisistheindexpage.server')
expect(homeHTML).toContain('env_var_test')
expect(homeHTML).toContain('foo.client')

expect(dynamicRouteHTML1).toContain('[pid]')
Expand Down

0 comments on commit 3effe08

Please sign in to comment.