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

CEP 11.1 Character Encoding Issue Breaking Module Import #500

Open
repli-a opened this issue Oct 8, 2023 · 1 comment
Open

CEP 11.1 Character Encoding Issue Breaking Module Import #500

repli-a opened this issue Oct 8, 2023 · 1 comment

Comments

@repli-a
Copy link

repli-a commented Oct 8, 2023

I am trying to import and use React Query Devtools, but when I do I get the following error: Uncaught SyntaxError: Invalid or unexpected token @ index.2eb963e7.js:156937

I went and found the corresponding line in the bundle which corresponds to the first line of the character map in this module export:

{"@parcel/transformer-js/src/esmodule-helpers.js":"flGkb"}],"5cRJZ":[function(require,module,exports) {
/**
 * match-sorter-utils
 *
 * Copyright (c) TanStack
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */ var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
parcelHelpers.defineInteropFlag(exports);
parcelHelpers.export(exports, "compareItems", ()=>compareItems);
parcelHelpers.export(exports, "rankItem", ()=>rankItem);
parcelHelpers.export(exports, "rankings", ()=>rankings);
const characterMap = {
    À: "A",
    �: "A",
    Â: "A",
    Ã: "A",
    Ä: "A",

At first I thought this was a bundler transformer/loader compatibility issue, but I was unable to reproduce anywhere but within the panel. The bundled code works fine everywhere else, and the character map looks like this:

    À: "A",
   Á: "A",
   Â: "A",
   Ã: "A",
   Ä: "A",

I then thought that maybe this was a Chrome version issue since CEF is running about two years behind, but I downloaded old versions as early as Chromium 86 and wasn't able to reproduce in codesandbox or the local dev server, only when debugging from the panel at localhost:8000. It seems that there is some other component internal to CEP (NW.js? Node?) that is causing this, but I'm at a loss as to what it is.

React Query works nicely within the panel which is great, but it would be nice to be able to use the devtools to better debug things in a meaningful context with all of the components of the application at our disposal for testing, rather than having to go to the trouble of mocking something up in a browser that approximates it solely for testing purposes.

Since it's not likely a fix will be forthcoming, is there possibly a workaround? Something that could be hardcoded in CEP or configured in the bundler/transpiler to fix whatever encoding issue is going on here?

@schroef
Copy link

schroef commented Nov 7, 2023

Dont you need to use html ascii coded special characters? In JSX i used this method and thats the only method they show and dont break scripts. Perhaps its not related, but its worth a try.

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