Closed samcarton closed 9 months ago
Can you directly call /root/.npm/_npx/f4a33d9b4519ccab/node_modules/@oxlint/linux-x64/oxlint and see what the error is?
You may also install the binary from github releases (under assets): https://github.com/oxc-project/oxc/releases
I tried running directly and kept getting not found
errors. Apparently this happens due to dynamic link failures in alpine.
adding gcompat
seemed to fix it in my project, though in this repro it still panics, though maybe that's expected if you run it without anything to actually lint?
FROM node:18-alpine
RUN apk add gcompat
ENV RUST_BACKTRACE=full
RUN npx oxlint@latest --quiet
output:
#6 [3/3] RUN npx oxlint@latest --quiet
#6 sha256:f44c592b1972dfcde6c56db5070b79eed323f47df61f290c1a69b4d16d74dd3b
#6 1.352 npm WARN exec The following package was not found and will be installed: oxlint@0.0.21
#6 2.827 thread 'main' panicked at library/alloc/src/raw_vec.rs:534:5:
#6 2.827 capacity overflow
#6 2.827 stack backtrace:
#6 2.827 0: 0x7f1f98f90e9f - <unknown>
#6 2.827 1: 0x7f1f98c9021c - <unknown>
#6 2.827 2: 0x7f1f98f5f43d - <unknown>
#6 2.827 3: 0x7f1f98f925ce - <unknown>
#6 2.827 4: 0x7f1f98f92194 - <unknown>
#6 2.827 5: 0x7f1f98f9318c - <unknown>
#6 2.827 6: 0x7f1f98f92c78 - <unknown>
#6 2.827 7: 0x7f1f98f92c06 - <unknown>
#6 2.827 8: 0x7f1f98f92bf1 - <unknown>
#6 2.827 9: 0x7f1f98c010b4 - <unknown>
#6 2.827 10: 0x7f1f98c7a8ce - <unknown>
#6 2.827 11: 0x7f1f98c4f33e - <unknown>
#6 2.827 12: 0x7f1f98c439c3 - <unknown>
#6 2.827 13: 0x7f1f98c5105f - <unknown>
#6 2.827 14: 0x7f1f995c06d1 - <unknown>
#6 2.840 npm notice
#6 2.840 npm notice New patch version of npm available! 10.2.3 -> 10.2.5
#6 2.840 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>
#6 2.840 npm notice Run `npm install -g npm@10.2.5` to update!
#6 2.840 npm notice
#6 DONE 2.9s
RUN npx oxlint@latest --quiet
this feels like running the linter on the entire file system?
Even against a single file I get some inconsistent behaviour
FROM node:18-alpine
# RUN apk add libc6-compat
RUN apk add gcompat
RUN echo "namespace foo {}" > test.ts
ENV RUST_BACKTRACE=full
RUN npx --yes oxlint@latest --max-warnings 0 test.ts
When I run docker build . --progress plain --no-cache
multiple times, sometimes it outputs the panic as above, sometimes it doesn't - but it doesn't seem to output the expected oxlint output.
#7 [4/4] RUN npx --yes oxlint@latest --max-warnings 0 test.ts
#7 sha256:15d4b9ebbd3ea1f5bb5fd1ec5a250d7454dab28aae915df7ec4c4a7a906f57b4
#7 2.413 npm notice
#7 2.413 npm notice New patch version of npm available! 10.2.3 -> 10.2.5
#7 2.414 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.5>
#7 2.414 npm notice Run `npm install -g npm@10.2.5` to update!
#7 2.414 npm notice
#7 DONE 2.5s
when I run $ npx --yes oxlint test.ts
locally against the same file I get this, as expected
⚠ typescript-eslint(no-namespace): ES2015 module syntax is preferred over namespaces.
╭─[test.ts:1:1]
1 │ namespace foo {}
· ─────────
╰────
help: Replace the namespace with an ES2015 module or use `declare module`
Finished in 6ms on 1 file with 70 rules using 16 threads.
Found 1 warning and 0 errors.
0.2.3-alpha.0 contains https://www.npmjs.com/package/@oxlint/linux-x64-musl
I'm not sure if it works :-/
+1, just worked and fixed my Docker build
thank god
EDIT: nvm, not working.
With the latest oxlint v0.2.5? So it's not a musl / glibc problem 🤔
wired. It works for me on node:18-alpine.
Seems like it's shadcn-vue issue. In their repo they had troubles with it as well. I just used previous version of their app and it worked.
I think for this issue to be resolved completely, you have to give oxc-parser the same treatment as oxlint in #2126.
It seems like the bindings of oxc-parser are needed in this case, not oxlint, as mentioned in the title of radix-vue/shadcn-vue#293.
Moving oxc-parser to a seperate issue: https://github.com/oxc-project/oxc/issues/2195
I'll close this issue for now, feel free to open another one with more information.
I'll also update the error messages: https://github.com/oxc-project/oxc/issues/2196
Error
Similar to #1690 but this is on an alpine docker image.
Minimal repro
dockerfile:
docker build .