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

[node v18.8.0] TypeError: Cannot destructure property 'payload' of 'sourceMap' as it is null #3093

Closed
markus-wa opened this issue Aug 25, 2022 · 6 comments

Comments

@markus-wa
Copy link

markus-wa commented Aug 25, 2022

Please provide details about:

  • What you're trying to do

npm test

  • What happened
$ npm test

> sample-pubsub@0.0.1 test
> ava


  Uncaught exception in test.js

  test.js:10

    9:
   10: test("get win/loss P PSuccess", (t) => {
   11:   const wl = getWinLossProbabilityPSuccess(0.186, 0.5, 5);

  TypeError: Cannot destructure property 'payload' of 'sourceMap' as it is null.

  › file://node_modules/mem/dist/index.js:42:27
  › file://node_modules/mem/dist/index.js:42:27
  › file://test.js:10:1

  ✔ get win/loss P PSuccess
    ℹ 0.3573732358018241 0.6426267641981759
  ✖ Internal error when running test.js
  TypeError: Cannot destructure property 'payload' of 'sourceMap' as it is null.
  TypeError: Cannot destructure property 'payload' of 'sourceMap' as it is null.
      at file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/snapshot-manager.js:398:9
      at file:///home/mark/dev/agkund/sportsbook-data/node_modules/mem/dist/index.js:42:27
      at mem.cacheKey.file.file (file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/snapshot-manager.js:409:31)
      at file:///home/mark/dev/agkund/sportsbook-data/node_modules/mem/dist/index.js:42:27
      at determineSnapshotPaths (file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/snapshot-manager.js:428:14)
      at load (file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/snapshot-manager.js:468:16)
      at get snapshots [as snapshots] (file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/runner.js:204:21)
      at Runner.saveSnapshotState (file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/runner.js:228:36)
      at file:///home/mark/dev/agkund/sportsbook-data/node_modules/ava/lib/worker/base.js:84:40
      at /home/mark/dev/agkund/sportsbook-data/node_modules/emittery/index.js:319:13


  ✖ test.js exited with a non-zero exit code: 1
  ─

  1 test passed
  1 uncaught exception
  • What you expected to happen

ava should work with node 18.8.0

it works fine with 18.7.0

Please share relevant sample code. Or better yet, provide a link to a minimal reproducible example.

could be related to the snapshot changes in node 18.8?
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.8.0

We'll also need your AVA configuration (in package.json or ava.config.* configuration files) and how you're invoking AVA. Share the installed AVA version (get it by running npx ava --version).

ava version 4.3.1

no ava.config

@gugu
Copy link

gugu commented Aug 25, 2022

node 18.7.0, same issue

@markus-wa
Copy link
Author

that's interesting @gugu 🤔 - 18.7.0 works fine for me

@markwylde
Copy link

markwylde commented Aug 25, 2022

Just got this issue on a build too on v18.8.0.

v18.7.0 worked perfectly though.

@gugu
Copy link

gugu commented Aug 25, 2022

sorry, my bad, 18.7 works for me as well

@novemberborn
Copy link
Member

#3091 and #3094, in progress.

@novemberborn novemberborn closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2022
@novemberborn
Copy link
Member

Should be fixed in 4.3.3.

Jason3S added a commit to streetsidesoftware/cspell-dicts that referenced this issue Aug 26, 2022
Jason3S added a commit to streetsidesoftware/cspell-dicts that referenced this issue Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants