Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

path error requiring macro #9

Open
alidcast opened this issue Dec 3, 2022 · 4 comments
Open

path error requiring macro #9

alidcast opened this issue Dec 3, 2022 · 4 comments

Comments

@alidcast
Copy link

alidcast commented Dec 3, 2022

Can be seeing running React example npx cherry run react/index.cljs

Seems to trip up when handling the local import (:require-macros ["./macros.mjs" :refer [$]])

[cherry] Running react/index.cljs
node:internal/errors:477
    ErrorCaptureStackTrace(err);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received null

I'm not sure what the status of macros are, but I was giving them a go before trying to import a library that used them, and ran into above issue.

@borkdude
Copy link
Member

borkdude commented Dec 3, 2022

Macros are currently running in SCI and should be required like so:

(:require-macros [macros :refer [$]])

The macros.cljc file should be in src/macros.cljc.

You may have gotten the example from an old version of cherry, where you could import .mjs but this is no longer the case since cherry works on both the JVM and JS so code has to run in the host and this is currently done using SCI.

Could you tell me where you found the other example, so we can update it?

@alidcast
Copy link
Author

alidcast commented Dec 3, 2022

@alidcast
Copy link
Author

alidcast commented Dec 3, 2022

does this relate to issue about loading namespaces/deps? squint-cljs/cherry#64

@borkdude
Copy link
Member

borkdude commented Dec 3, 2022

This example should be updated. I'll keep this issue open so I can do that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants