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

feat: Add support for Node JS #36

Merged
merged 1 commit into from
Dec 17, 2020
Merged

Conversation

GordonSmith
Copy link
Member

Refactor tests so they can run from browser and NodeJS

Signed-off-by: Gordon Smith [email protected]

Refactor tests so they can run from browser and NodeJS

Signed-off-by: Gordon Smith <[email protected]>
@GordonSmith GordonSmith merged commit 1fef565 into hpcc-systems:trunk Dec 17, 2020
@GordonSmith GordonSmith deleted the NODE_JS branch December 17, 2020 11:28
@meoyawn
Copy link

meoyawn commented Dec 17, 2020

just tried pulling 1.0.0 and got

error - ./node_modules/@hpcc-js/wasm/dist/index.es6.js:2:0
Module not found: Can't resolve 'fs'
null

when trying to run this on Next.js

@GordonSmith
Copy link
Member Author

Hmmm sounds like the es6 is leaking a conditional NodeJS requirement...

You can work around it with the following: vercel/next.js#7755 but I will investigate my end to see if I can clean it up as well...

@meoyawn
Copy link

meoyawn commented Dec 17, 2020

image

also a weird thing on 0.3.15: importing a (supposedly) simple wasm wrapper pulls 425kB of JS. I'm very new to JS modules but maybe this includes webpack polyfilling node modules like fs...

@meoyawn
Copy link

meoyawn commented Dec 17, 2020

though my editor plugin is probably wrong https://bundlephobia.com/result?p=@hpcc-js/[email protected]

@GordonSmith
Copy link
Member Author

You can also see the individual file sizes here: https://cdn.jsdelivr.net/npm/@hpcc-js/[email protected]/dist/

The index.min.js is probably the most accurate.

@GordonSmith
Copy link
Member Author

@meoyawn I just released 1.0.1 which should fix your issue (if you can verify that would be appreciated).

@meoyawn
Copy link

meoyawn commented Dec 18, 2020

@GordonSmith can confirm 1.0.1 works with next.js, thanks!

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

Successfully merging this pull request may close these issues.

2 participants