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

create-react-app compatibility #246

Open
ghost opened this issue Sep 9, 2021 · 3 comments
Open

create-react-app compatibility #246

ghost opened this issue Sep 9, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 9, 2021

Hello when I try to compile my TypeScript create react app project I get this:

Any ideas on how to solve?

thanks!

Failed to compile.

./node_modules/istextorbinary/edition-browsers/index.js 68:27
Module parse failed: Unexpected token (68:27)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|   const textEncoding = 'utf8';
|   const binaryEncoding = 'binary';
>   const chunkLength = opts?.chunkLength ?? 24;
|   let chunkBegin = opts?.chunkBegin ?? 0; // Discover
|
@balupton balupton changed the title nullish coalescing operator results in failure to compile create-react-app compatibility Sep 10, 2021
@balupton
Copy link
Member

balupton commented Oct 4, 2021

Did you get it working, if so what needed to be changed?

@andygock
Copy link

andygock commented Oct 5, 2021

[email protected] still not working with [email protected]

Failed to compile.

./node_modules/istextorbinary/edition-browsers/index.js 68:86
Module parse failed: Unexpected token (68:86)
File was processed with these loaders:
 * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|   const textEncoding = 'utf8';
|   const binaryEncoding = 'binary';
>   const chunkLength = (opts === null || opts === void 0 ? void 0 : opts.chunkLength) ?? 24;
|   let chunkBegin = (opts === null || opts === void 0 ? void 0 : opts.chunkBegin) ?? 0; // Discover
|

@ghost
Copy link
Author

ghost commented Oct 6, 2021

No I didn't get it working with TypeScript. Instead I had to import it as JavaScript into my TypeScript program.

Like this:

https://github.com/bootrino/reactoxide/blob/master/reactoxide/src/editor/textorbinary.js

Feels hacky - still hoping this will eventually support TypeScript and create react app.

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