An invalid or illegal string was specified

An invalid or illegal string was specified

Comments

Copy link Quote reply

acgillette commented Jul 24, 2017

I am using a tone.js script in a project I’m building. It works fine in Chrome and Safari, but when I attempt to play it in Firefox I get this error.

Here is the full trace:

And here is the script I’m using:

I’m unsure if this is a firefox issue or an issue with my script.

This comment has been minimized.

Copy link Quote reply

tambien commented Jul 25, 2017

Thanks for the issue. i think this is related to #239. The error is not thrown if you schedule the time slightly in the future like this.

I’ve fixed this problem in the latest dev build. You can checkout the results here.

I’m going to close for now, since it seems to be a duplicate of #239 and it’s easier for me to track it in one place.

I’m getting a SyntaxError: An invalid or illegal string was specified , while trying to connect to a WebSocket on Firefox.

Why do I get this error?

1 Answer 1

It seems like the scheme is mandatory when trying to connect to a WebSocket, so this:

works just fine.

Not the answer you’re looking for? Browse other questions tagged javascript firefox websocket or ask your own question.

Related

Hot Network Questions

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Читайте также:  Mysql загрузка данных из файла

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.11.15.35459

Firefox ошибка An invalid or illegal string was specified» code: «12
Ошибка чаще всего происходит при работе с Canvas. Возможно она пройдет у браузера в дальнейшем, но на сегодняшний день (Версия Firefox 4) она возникает.
В интернете полно различных вариантов решения проблемы, но способ решение зависит от проблемы, породившей ошибку.
Вот несколько вариантов:

  • Удалить комментарии из CSS— самый удивительный способ, мне не помог, но говорят в других случаях спасает
  • Удалить из Javascript все упоминания о console.log() — проверял сам, не Firefox вообще не очень работает с этой командой, могут возникать и другие виды ошибок, особенно при отключенном Firebug
  • Проверить правильность используемых команд для рисования на Canvas — действительно сработало в моем случае, так как при загрузке я сразу пытался отрисовать дугу не инициализированными значениями, и получалось, что точка начала дуги совпадала с точкой её завершения (из 0 в 0) и Firefox’овский Canvas на это ругался (другие браузеры спокойно эту ошибку обходят)

Честно говоря, очень расстроила такая ситуация с Firefox. Получается, что эта ошибка — это как флажок какого-то бага движка Firefox, который выкидывается когда не поподя. И разбирайся с ним сам как хочешь, никаких подсказок.

Ссылка на основную публикацию
Adblock
detector