graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

Library file 'microevent.ts' not found.

Open yoratoni opened this issue 2 years ago • 6 comments

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

  1. Cloning an existing subgraph
  2. yarn install etc..
  3. Run the codegen command.
  4. Run the build command.

Expected behavior

Expected the subgraph to build fine.

Screenshots or Videos

No response

Platform

  • OS: Windows 10
  • NodeJS: 16.20.0
  • @graphprotocol/graph-cli version: 0.49.0
  • @graphprotocol/graph-ts version: 0.30.0

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

yoratoni avatar May 09 '23 15:05 yoratoni

Bump

Corantin avatar Oct 01 '23 06:10 Corantin

Did you found any workaround? :)

Corantin avatar Oct 01 '23 07:10 Corantin

@Corantin @yoratoni to confirm this is an issue only on Windows 10?

azf20 avatar Oct 09 '23 09:10 azf20

Did you found any workaround? :)

Yeah, I switched to a sublinux environment (WSL) ^^

yoratoni avatar Oct 09 '23 10:10 yoratoni

@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.

yoratoni avatar Oct 09 '23 10:10 yoratoni

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

levalleux-ludo avatar Feb 27 '24 14:02 levalleux-ludo