react-code-dataset / next.js /test /development /app-dir /externalize-node-binary-browser-error /externalize-node-binary-browser-error.test.ts
Download next.js/test/development/app-dir/externalize-node-binary-browser-error/externalize-node-binary-browser-error.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 983 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/app-dir/externalize-node-binary-browser-error/externalize-node-binary-browser-error.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/app-dir/externalize-node-binary-browser-error/externalize-node-binary-browser-error.test.ts
-
curl -L -o externalize-node-binary-browser-error.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/app-dir/externalize-node-binary-browser-error/externalize-node-binary-browser-error.test.ts
983 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| import { | |
| assertHasRedbox, | |
| getRedboxDescription, | |
| getRedboxSource, | |
| } from 'next-test-utils' | |
| // FIXME: er-enable when we have a better implementation of node binary resolving | |
| describe.skip('externalize-node-binary-browser-error', () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| it('should error when import node binary on browser side', async () => { | |
| const browser = await next.browser('/') | |
| await assertHasRedbox(browser) | |
| const redbox = { | |
| description: await getRedboxDescription(browser), | |
| source: await getRedboxSource(browser), | |
| } | |
| expect(redbox.description).toBe('Failed to compile') | |
| expect(redbox.source).toMatchInlineSnapshot(` | |
| "./node_modules/foo-browser-import-binary/binary.node | |
| Error: Node.js binary module ./node_modules/foo-browser-import-binary/binary.node is not supported in the browser. Please only use the module on server side" | |
| `) | |
| }) | |
| }) | |