-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
@swc/core threw an error when attempting to validate swc compiler options. #5616
Comments
Which os/cpu are you using? |
Also, did you use something like |
Thanks for the quick reply! I added more information under System Info. No Also for completeness, here is the definition of
|
Quick update, the same project/commit successfully built on the same machine (also Parallels) under Windows. Updating to |
Did you share the project directory? You should install on target platform unless you are overriding npm config |
I was able to reproduce this issue with my Apollo Federation Gateway running in a Node docker container. I can provide the Dockerfile. FROM node:17.3
WORKDIR /app
ENV NODE_ENV=dev
ENV ZIPKIN=http://localhost:9411
EXPOSE 4000
COPY . .
CMD ["yarn", "run", "dev"] Also important to note is that I'm not experiencing this issue when I run this directly on my machine. encountered this error on
fwiw I'm running this
|
I have the same problem, I can't start my project at all with Docker/TS-Node/SWC |
Can you try to reinstall swc in your docker? |
That's what I am doing Dockerfile:
.dockerignore:
|
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think this was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This issue is still valid |
I'm also running into this issue after updating from
|
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think this was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
The issue is still valid. |
Not sure why bot aggressively marks this one 🤔 |
@btecu @Bluzzi My co-worker found a fix for this, inside The solution was to put
I don't know if it'll solve your guy's problems, but it did solve mine! |
Thanks @jgujgu. Is there anything for |
Having the same issue. The only solution is to completely nuke the nvm (fnm) Node environment, and the local node_modules and do a full re-install. Seems like something gets written into the global scope, that has an effect on this? |
Never mind, just did it again without node (nvm) nuking, just For us, the cause of this misalignment, I think, is Renovate Bot. Every time it updates a dep, and I do a pull, then the breakage will occur. |
Same problem. Runs fine on MacOS in local env and throws while building on Docker. The workaround is use |
|
This comment has been minimized.
This comment has been minimized.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
@jaybe78 This is not a bug of swc |
I put it again here, in case it helps someone. |
adding the core modules as optional dependencies for the project fixed the error for me: npm install --save-optional \
"@swc/core-darwin-arm64" \
"@swc/core-darwin-x64" \
"@swc/core-linux-arm-gnueabihf" \
"@swc/core-linux-arm64-gnu" \
"@swc/core-linux-arm64-musl" \
"@swc/core-linux-x64-gnu" \
"@swc/core-linux-x64-musl" \
"@swc/core-win32-arm64-msvc" \
"@swc/core-win32-ia32-msvc" \
"@swc/core-win32-x64-msvc" you can also filter out the list of packages in case you are certain what is the OS / architecture of your development computer and the CI. hope this helps for others until the issue is resolved! |
I was having the same issue @pcdevil 's response solved the issue - thanks!! |
thanks @pcdevil that was the solution for me (when compiling react-email in docker) |
I'm having this issue re-appear with EDIT: My issue is actually a ts-node issue. See: |
I can work around this by simply |
just clear |
The following changes were made to support React 18: - Updated `react` and `react-dom` dev dependency versions from 17.0.2 to 18.2.0 - Updated peer dependencies to allow React 18 - Updated `react-collapsed` from v3.6.0 to v4.1.2 which supports React 18 - Copied `@reach/auto-id`'s `useId` hook with minor modifications from https://github.com/reach/reach-ui/blob/dev/packages/auto-id/src/reach-auto-id.ts. Because the peer dependencies of that library don't allow React 18, we weren't able to install it directly anymore. This `useId` hook uses React 18's `useId` hook if it's present and otherwise falls back to custom logic for React 16 and 17. - Added a new `renderPin` prop to `MapboxMap` to allows React 18 users to render custom JSX into the DOM node for the marker element. This gets around the issue of having to call `createRoot` from `react-dom/client` in `MapboxMap`. This was causing issues on React 16/17 sites because Vite and Webpack were unable to determine that the dynamic import of `react-dom/client` wouldn't be reachable, and tried to resolve the package unsuccessfully. Rather than force existing consumers of the repo to update their bundler config to exclude `react-dom/client`, we provide this optional prop to React 18 users if they want to use React 18 features in their custom pin component, or if they don't want to get the console warning about using `ReactDOM.render` if they use the `PinComponent` prop. To support testing in React 18: - We are now fetching TextEncoder from utils when setting up the test environment because the new react-dom does not have it - `@testing-library/react-hooks` doesn't support React 18 and it's functionality has now been added to `@testing-library/react` in v14. Because of this, `@testing-library/react` was upgraded to v14.2.1, which only supports React 18, and `@testing-library/react-hooks` was removed from the dev dependencies. The GitHub workflow for testing React 16 and 17 was updated to manually downgrade `@testing-library/react` to v12 and install `@testing-library/react-hooks`. Custom logic is added so that if `@testing-library/react-hooks` is installed, it's `renderHook` method is used (i.e. React 16/17), and otherwise the `renderHook` method from `@testing-library/react` is used (React 18). J=BACK-2911, BACK-2923 TEST=auto, manual Updated the test-site to use the new React 18 app initialization and tested all updated components manually to ensure they're not broken. Did a local npm pack of the repo and successfully used it in Pages repos with React 17 and 18. Some updates were also made to clean up our tests: - Upgraded `@testing-library/user-event` from v13.5.0 to v14.5.2, which makes async calls, so we no longer need `waitFor`. As part of this change, we started getting some new console errors when trying to navigate in tests by clicking links. This is because navigation is not defined in the jest jsdom environment. A util function was added to mock the console to remove these errors. - Updated the GitHub test workflow for React 16 and 17 to manually install optional swc libraries because the post install script doesn't seem to run properly after we install specific versions of react-related packages. More info at swc-project/swc#5616 (comment) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nidhi Manu <[email protected]>
I worked around this with:
These are pretty old versions - there's likely newer ones that work, I just grabbed these from a project where I didn't have this issue. |
I'm having same issue using |
@throrin19 there is a deprecation warning against |
Can someone provide a minimal repro? |
The installation always fails on certain servers. For me specifically, in the cheap ones running on vCPUs.
Let me know if I can provide you with nay additional information. (We have resorted to version locking swc manually in our monorepo for now, which isn't good. ) |
For those still struggling heres what worked for me
|
If your problem is locally, I mean, you are using docker-compose pay attention to the shared volumes, probably it is sharing the wrong file between your windows system and your container running linux. You can solve it excluding your node_modules from the sharing volumes from you docker-compose.yml file like this:
|
SWC has trouble installing in CI swc-project/swc#5616 swc-project/swc#5837
Describe the bug
Hi there,
I am using
@swc/core
to speedup the execution of my test suite with avajs/ava.System info:
Ubuntu 20.04.1 (VM via parallels 18 on a Mac Mini Intel)
node 16.15.0
During
npm run test
I receive the following error, and I am not sure how to resolve the issue.Input code
No response
Config
Snippet of
tsconfig.json
config:Playground link
No response
Expected behavior
Successful execution of
npm run test
.Actual behavior
No response
Version
v1.2.241
Additional context
No response
The text was updated successfully, but these errors were encountered: