power-assert-js / babel-preset-power-assert

Babel preset for all power-assert plugins
MIT License
32 stars 2 forks source link

TypeError: Cannot convert a Symbol value to a string #14

Open make-github-pseudonymous-again opened 9 months ago

make-github-pseudonymous-again commented 9 months ago

I get the following obscure error when the following assertion is executed:

assert(
  await findCode(
    [{filter: filter(resolveFromFile, resolveRequire)}],
    glob(patterns),
    {
      read,
    },
  ),
);
  error: TypeError: Cannot convert a Symbol value to a string
      at RegExp.test (<anonymous>)
      at sanitizeKey (/node_modules/stringifier/strategies.js:263:27)
      at Object.<anonymous> (/node_modules/stringifier/strategies.js:252:26)
      at /node_modules/traverse/index.js:188:40
      at Array.forEach (<anonymous>)
      at forEach (/node_modules/traverse/index.js:19:30)
      at walker (/node_modules/traverse/index.js:185:4)
      at walk (/node_modules/traverse/index.js:208:3)
      at Traverse.forEach (/node_modules/traverse/index.js:255:15)
      at Traverse.reduce (/node_modules/traverse/index.js:262:7)

If I remove babel-preset-power-assert from babel presets I do not get this error.

twada commented 9 months ago

@make-github-pseudonymous-again Thanks for reporting! I'll fix it soon.

twada commented 9 months ago

@make-github-pseudonymous-again patch release has done.

https://github.com/twada/stringifier/releases/tag/v2.1.1

make-github-pseudonymous-again commented 9 months ago

Wow thanks!

make-github-pseudonymous-again commented 9 months ago

Not sure it's enough though since renderers depend on v1.x.x:

power-assert-renderer-comparison@^1.0.7:
  version "1.2.0"
  resolved "https://registry.yarnpkg.com/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz#e4f88113225a69be8aa586ead05aef99462c0495"
  integrity sha512-7c3RKPDBKK4E3JqdPtYRE9cM8AyX4LC4yfTvvTYyx8zSqmT5kJnXwzR0yWQLOavACllZfwrAGQzFiXPc5sWa+g==
  dependencies:
    core-js "^2.0.0"
    diff-match-patch "^1.0.0"
    power-assert-renderer-base "^1.1.1"
    stringifier "^1.3.0"
    type-name "^2.0.1"

power-assert-renderer-diagram@^1.0.7:
  version "1.2.0"
  resolved "https://registry.yarnpkg.com/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz#37f66e8542e5677c5b58e6d72b01c0d9a30e2219"
  integrity sha512-JZ6PC+DJPQqfU6dwSmpcoD7gNnb/5U77bU5KgNwPPa+i1Pxiz6UuDeM3EUBlhZ1HvH9tMjI60anqVyi5l2oNdg==
  dependencies:
    core-js "^2.0.0"
    power-assert-renderer-base "^1.1.1"
    power-assert-util-string-width "^1.2.0"
    stringifier "^1.3.0"
twada commented 9 months ago

@make-github-pseudonymous-again Ohh sorry, also made a v1 patch release. Would you give it a try?

https://github.com/twada/stringifier/releases/tag/v1.4.1

make-github-pseudonymous-again commented 9 months ago

Ohh sorry, also made a v1 patch release. Would you give it a try?

@twada Yep, works.