Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running test locally always fails #32031

Closed
mozeryansky opened this issue Dec 2, 2021 · 2 comments · Fixed by #32042
Closed

Running test locally always fails #32031

mozeryansky opened this issue Dec 2, 2021 · 2 comments · Fixed by #32042
Labels
bug Issue was opened via the bug report template.

Comments

@mozeryansky
Copy link
Contributor

What version of Next.js are you using?

12.0.4

What version of Node.js are you using?

14.18.1

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

yarn test

Describe the Bug

Everytime I try to run the tests I get the error below.

I have been running a single test using node ./node_modules/.bin/jest -- test/development/acceptance/ReactRefreshLogBox.test.ts and writing .only for a single test.

...
    > Loading browser with http://localhost:58844/

      at Object.webdriver [as default] (lib/next-webdriver.ts:58:13)

error - ./node_modules/next/dist/client/dev/amp-dev.js
TypeError: Cannot read property 'error' of undefined
(node:29703) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
wait  - compiling /_error (client and server)...
error - ./node_modules/next/dist/client/dev/amp-dev.js
TypeError: Cannot read property 'error' of undefined
error - Error: Cannot find module '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/.next/fallback-build-manifest.json'
Require stack:
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/load-components.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/utils.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/store.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/index.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/cli/next-dev.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/bin/next
Error: Cannot find module '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/.next/fallback-build-manifest.json'
Require stack:
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/load-components.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/utils.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/store.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/index.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/cli/next-dev.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/bin/next
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.mod._resolveFilename (/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/webpack/require-hook.js:171:28)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.loadDefaultErrorComponents (/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/load-components.js:22:24)
    at DevServer.getFallbackErrorComponents (/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/dev/next-dev-server.js:679:43)
    at async DevServer.renderErrorToResponse (/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/next-server.js:1730:40)
    at async pipe.req.req (/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/next-server.js:1670:30)
    at async DevServer.pipe (/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/next-server.js:1148:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/load-components.js',
    '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/utils.js',
    '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/store.js',
    '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/index.js',
    '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/cli/next-dev.js',
    '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/bin/next'
  ]
}
error - Error: Cannot find module '/private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/.next/fallback-build-manifest.json'
Require stack:
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/server/load-components.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/utils.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/store.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/build/output/index.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/cli/next-dev.js
- /private/var/folders/md/c2qmk35d0j90c__dm0yn5cgw0000gn/T/next-install-1638432702733/node_modules/next/dist/bin/next
  console.log
    browser log: Failed to load resource: the server responded with a status of 500 (Internal Server Error)
...

Expected Behavior

Tests to pass

To Reproduce

Clone rep
yarn

yarn test
or
node ./node_modules/.bin/jest -- test/development/acceptance/ReactRefreshLogBox.test.ts

@mozeryansky mozeryansky added the bug Issue was opened via the bug report template. label Dec 2, 2021
@balazsorban44
Copy link
Member

As pointed out in the contributing.md, you should run tests with yarn testheadless.

You can pass the test path to that command directly, so

yarn testheadless test/development/acceptance/ReactRefreshLogBox.test.ts

kodiakhq bot pushed a commit that referenced this issue Dec 3, 2021
Removes `yarn test` from the scripts as it has the wrong options. `yarn testonly` or `yarn testheadless` are the way to run tests. Fixes #32031


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
Kikobeats pushed a commit that referenced this issue Dec 3, 2021
Removes `yarn test` from the scripts as it has the wrong options. `yarn testonly` or `yarn testheadless` are the way to run tests. Fixes #32031


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
Removes `yarn test` from the scripts as it has the wrong options. `yarn testonly` or `yarn testheadless` are the way to run tests. Fixes vercel#32031


## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `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`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants