You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran the tests of the orama package from a devcontainer and unfortunately the dataset.test.ts and insert.test.ts failed with the error: SyntaxError: Unexpected identifier 'assert'
This happens because the devcontainer uses node:lts-alpine as base image. At the time that I'm writing this issue, the version of node which this image uses is node v22. This version does not support anymore the assert, in favour of the new keyword with.
So, in order to fix this error, I think we can either:
replace assert with with, or
fix the node version of the devcontainer to node v20, for example using the image node:20-alpine.
In addition, I googled the error and I found this very useful stackoverflow post which I do recommend you to read. In this post there is a very detailed overview of the problem and it is explained how swapping assert with with will fix the problem for node 22 and later, but with the consequence of breaking it for Node 16 and 17.
So, what do you think about it? Let me know and I would be glad to open a pr.
To Reproduce
Open the orama repository in a devcontainer. Make sure you are using the latest node:lts-alpine image (check that the node version is v22 from a shell inside the container with node -v).
Run the tests of the orama package.
Expected behavior
I expect the tests to succeed.
Environment Info
Infos of the devcontainer:
- OS: Alpine Linux v3.21
- Node: 22.13.0
- Orama: 3.0.5
Affected areas
Environment/OS
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
I ran the tests of the orama package from a devcontainer and unfortunately the
dataset.test.ts
andinsert.test.ts
failed with the error:SyntaxError: Unexpected identifier 'assert'
This happens because the devcontainer uses
node:lts-alpine
as base image. At the time that I'm writing this issue, the version of node which this image uses isnode v22
. This version does not support anymore theassert
, in favour of the new keywordwith
.So, in order to fix this error, I think we can either:
assert
withwith
, orIn addition, I googled the error and I found this very useful stackoverflow post which I do recommend you to read. In this post there is a very detailed overview of the problem and it is explained how swapping
assert
withwith
will fix the problem for node 22 and later, but with the consequence of breaking it for Node 16 and 17.So, what do you think about it? Let me know and I would be glad to open a pr.
To Reproduce
node:lts-alpine
image (check that the node version isv22
from a shell inside the container withnode -v
).Expected behavior
I expect the tests to succeed.
Environment Info
Affected areas
Environment/OS
Additional context
The text was updated successfully, but these errors were encountered: