Open steinybot opened 2 years ago
JSON formats work correctly if you don't need to run js.
relay-compiler once accepted relay.config.cjs
as a valid config file in the past. And I think doing so once again will be an easiest fix to this issue. I'm willing to implement it if relay team says that's acceptible fix.
Any thought?
relay-compiler once accepted
relay.config.cjs
as a valid config file in the past. And I think doing so once again will be an easiest fix to this issue. I'm willing to implement it if relay team says that's acceptible fix.Any thought?
Oh, we probably removed cjs by mistake.
Will we add back the support for CJS? Thank you!
JSON formats work correctly if you don't need to run js.
Convert the relay.config.js
to relay.config.json
apparently solves my problem, seems the relay has some issues with the compatibility between ESModulesJS
and CommonJS
Environment:
package.json use the "type": "module"
relay version: 15.0.0
vite: 5.4.1 and using the vite-plugin-relay-lite
library to define plugin configs to run with relay
ESM
Node: 18.5.0
package.json
:relay.config.js
:Run:
yarn run relay
It fails with:
CJS (.js)
See what happens if we modify it to be CJS:
relay.config.js
:Run:
yarn run relay
It fails with:
CJS (.cjs)
Now try and rename it from
relay.config.js
torelay.config.cjs
like it says.Also update
package.json
to:Run:
yarn run relay
Now it fails with: