question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lab/overwriteReadonlyProp.ts:34:63 Implicit conversion of a 'symbol' to a 'string' will fail at runtime

See original GitHub issue

I am a deno user and recently switched to deno’s new vendoring feature. This means I am no longer using the cached (transpiled .js) version, but rather the .ts source code.

Deno gives me the following error (tsafe@1.0.0):

TS2731 [ERROR]: Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'.
        throw new Error(`Probably a wrong ides to overwrite ${propertyName} getter`);
                                                              ~~~~~~~~~~~~
    at .../raw.githubusercontent.com/garronej/tsafe/v1.0.0/deno_dist/lab/overwriteReadonlyProp.ts:34:63

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
andreas-wagnercommented, Aug 24, 2022

Yes it’s gone, Thank you! Please check the other 2 bugs on minimal_polyfills@2.2.1 as well.

Deno provides vendoring via deno vendor [FILE].

In my case:

# remove the import-map from the configuration file
deno eval 'import j from \"./deno.json\" assert { type: \"json\" }; delete j.importMap; Deno.writeTextFile(\"./deno.json\", JSON.stringify(j, null, 2));'

# clear the vendored modules, so we don't pile up old ones
rm -rf .deno_vendor

# vendor all denpendencies of deps.ts into .deno_vendor
deno vendor --force --output=.deno_vendor deps.ts
0reactions
andreas-wagnercommented, Aug 26, 2022

Ah cool evt@v2.4.0 fixes this one (can be closed): https://github.com/garronej/minimal_polyfills/issues/6

But it does not fix the one you closed: https://github.com/garronej/minimal_polyfills/issues/7

I still get this:

error: TS2564 [ERROR]: Property '[Symbol.toStringTag]' has no initializer and is not definitely assigned in the constructor.
    [Symbol.toStringTag]: string;
    ~~~~~~~~~~~~~~~~~~~~
    at file:///.../.deno_vendor/raw.githubusercontent.com/garronej/minimal_polyfills/v2.2.1/deno_dist/Map.ts:14:5

Looking in my .deno_vendor folder, it seems that now both minimal-polyfills@v2.2.1 and minimal-polyfills@v2.2.2 are used. Maybe there is another dependency in Evt that is using the “old” minimal-polyfills?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Symbols not convert string implicitly - Stack Overflow
toString() works well, but I can't use '' + Symbol('test') ? It will throw Error: cannot convert a Symbol value to a string....
Read more >
Cannot convert a Symbol value to a string #12169 - GitHub
Symbol values indeed can't be converted to any other type (other than by calling .toString() ), and the type checker does catch other ......
Read more >
Symbols • JavaScript for impatient programmers (ES2022 ...
Table 15: The results of converting symbols to other primitive types. Convert to, Explicit conversion, Coercion (implicit conv.) boolean, Boolean(sym) → ...
Read more >
What are symbols and how they can be useful to you
A big part of it is the implicit conversion that happens when we use ... Uncaught TypeError: Cannot convert a Symbol value to...
Read more >
Receiving error "Cannot convert a Symbol value to a string" at ...
I am getting an error while publishing message from one web Component: [error = TypeError: Cannot convert a Symbol value to a string...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found