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

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

Open
make-github-pseudonymous-again opened this issue Feb 4, 2024 · 6 comments

Comments

@make-github-pseudonymous-again

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
Copy link
Member

twada commented Feb 5, 2024

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

@twada
Copy link
Member

twada commented Feb 5, 2024

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

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

@make-github-pseudonymous-again
Copy link
Author

Wow thanks!

@make-github-pseudonymous-again
Copy link
Author

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
Copy link
Member

twada commented Feb 5, 2024

@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
Copy link
Author

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

@twada Yep, works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants