Open yodiyo opened 2 months ago
I can look into this, however if you are starting a new project, I recommend that you look into Vite or Next, as CRA is deprecated. They stopped updating it years ago.
I'm seeing the same error in a webpack typescript react app. NOT using cra.
ERROR in ./node_modules/@cascadia-code/scroll-to-hash-element/src/index.tsx 4:0
Module parse failed: The keyword 'interface' is reserved (4:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
|
> interface ScrollToHashElementProps {
| behavior?: ScrollBehavior;
| inline?: ScrollLogicalPosition;
I'm guessing the build was not ran before publishing, because looking at the installed package in my node_modules/
shows only a src/index.tsx
and no dist/index.js
as called out by the package.json: "main": "dist/index.js",
I'll check this out.
I've updated to version 2.0.3 which now should output a compiled index.js
file into the dist
folder.
Please let me know if this resolves the issue for you.
@ncoughlin At the moment, there is no type in the latest version of the package that breaks the build.
I also noticed that you have a commit where you added them, but the latest version does not include this commit
I'm getting an error when trying to use this with CRA, even with the TS compiler.
Failed to compile. Module parse failed: The keyword 'interface' is reserved (4:0) File was processed with these loaders:
It's similar to an issue explain here - https://github.com/facebook/create-react-app/issues/5623 - the final comment suggests that the package should be compiled before publishing.
Hope that helps.