Closed strozw closed 3 years ago
IE11 & core-js is not support RegExp dotAll flag.
So IE11 throw Error: TypeError: Syntax error in regular expression in xstyled 2.3.0 and later.
Error: TypeError: Syntax error in regular expression
Probably need to fix the following code to resolve this issue. https://github.com/gregberge/xstyled/blob/main/packages/core/src/transform.ts#L32
For example, stop using the dotall flag and use [\s\S] instead of .. https://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-work
[\s\S]
.
To transpile application by babel 7 & core-js 3, that using xstyled 2.3.0 and later. and exec on IE11.
Woking on IE11
Sorry, I'm not ready yet.
npx envinfo --system --binaries --npmPackages @xstyled/system,@xstyled/styled-components,styled-components --markdown --clipboard
## System: - OS: macOS 11.2.3 - CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz - Memory: 15.57 GB / 64.00 GB - Shell: 5.8 - /usr/local/bin/zsh ## Binaries: - Node: 14.15.4 - ~/.asdf/installs/nodejs/14.15.4/bin/node - Yarn: 1.22.10 - /usr/local/bin/yarn - npm: 6.14.10 - ~/.asdf/installs/nodejs/14.15.4/bin/npm - Watchman: 4.9.0 - /usr/local/bin/watchman ## npmPackages: - @xstyled/styled-components: 2.4.1 => 2.4.1 - styled-components: 5.2.3 => 5.2.3
Thanks!
@gregberge I put the fix for this on main and next. Do you want to make a v2 release?
Fixed in v2.5
š Bug Report
IE11 & core-js is not support RegExp dotAll flag.
So IE11 throw
Error: TypeError: Syntax error in regular expression
in xstyled 2.3.0 and later.Probably need to fix the following code to resolve this issue. https://github.com/gregberge/xstyled/blob/main/packages/core/src/transform.ts#L32
For example, stop using the dotall flag and use
[\s\S]
instead of.
. https://stackoverflow.com/questions/1068280/javascript-regex-multiline-flag-doesnt-workTo Reproduce
To transpile application by babel 7 & core-js 3, that using xstyled 2.3.0 and later. and exec on IE11.
Expected behavior
Woking on IE11
Link to repl or repo (highly encouraged)
Sorry, I'm not ready yet.
Run
npx envinfo --system --binaries --npmPackages @xstyled/system,@xstyled/styled-components,styled-components --markdown --clipboard