Library file 'microevent.ts' not found.
Which packages are impacted by your issue?
@graphprotocol/graph-cli
Describe the issue
Note: This bug seems to only appear on Windows, I tried with the same environment on Ubuntu, it worked file.
When trying to build a subgraph, this error appears:
Library file 'microevent.ts' not found..
I tried to trace back the issue a bit:
It seems to be linked to AssemblyScript and the custom defined libs at line 626 - 646 in:
node_modules/@graphprotocol/graph-cli/node_modules/assemblyscript/cli/asc.js.
At line 643 inside of that file, it tries to read the microevent.ts library as a file with fs.readFileSync() inside of the node_modules, so of course, it returns null and prints the error.
Reproduction
www.thegraph.com
Steps to Reproduce the Bug or Issue
- Cloning an existing subgraph
- yarn install etc..
- Run the
codegencommand. - Run the
buildcommand.
Expected behavior
Expected the subgraph to build fine.
Screenshots or Videos
No response
Platform
- OS: Windows 10
- NodeJS: 16.20.0
@graphprotocol/graph-cliversion: 0.49.0@graphprotocol/graph-tsversion: 0.30.0
Subgraph Manifest
No response
Subgraph GraphQL Schema
No response
Additional context
No response
Bump
Did you found any workaround? :)
@Corantin @yoratoni to confirm this is an issue only on Windows 10?
Did you found any workaround? :)
Yeah, I switched to a sublinux environment (WSL) ^^
@Corantin @yoratoni to confirm this is an issue only on Windows 10?
Yeah definitely, I switched to WSL after not being able to solve the issue and it works perfectly fine now.
I've got the same issue, on Windows 10 as well with [email protected] and [email protected] Just downgrade graph-cli to the previous version I used ([email protected]) and the problem disappears