-
Notifications
You must be signed in to change notification settings - Fork 207
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
Doesn't work with yarn workspaces #258
Comments
Looks like you figured the Due to the way the AssemblyScript compiler works, we're using our own logic to look up the |
Having said that, it should be easy to add support for this. |
For what it's worth, I just managed to fix this by using nohoist: // package.json
{
...
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"packages/subgraph/@graphprotocol/graph-ts",
"packages/subgraph/@graphprotocol/graph-ts/**"
]
}
} |
Any update on this? I'm getting the following when trying to have subgraph as a yarn workspace package.
|
Updating |
OMG thank you. This solved my problem as well with yarn workspaces |
I'm getting a similar issue: |
My solution was to just uninstall and reinstall everything related to the graph protocol on my computer. That fixed it for me. |
I'm seeing a similar issue when trying to install an external dependency in Typescript, but not within a workspace project. In my case, I'm importing a Typescript dependency on my
(these are JavaScript compiled files, and I'm fetching directly from the folders but they are also exported as you can see in the source package) As a result, I cannot compile the project:
You can replicate this error in the following branch. |
@jjperezaguinaga as Jannis commented above, the import process into AssemblyScript is different and does not follow the same standards as node.js. As far as I know, important is that the source .ts files are deployed to NPM. That said, there is a library that seems to be importable: protofire/subgraph-toolkit. The only difference that I see currently, is that you do not expose a |
@schmidsi Reporting back as promised. Although I successfully managed to have Although I can live with that, I started to wonder how many of these libraries are actually supported, or whether which will prompt you to include Furthermore, I tried with @otaviopace PR #690 as you can see in my branch to no avail. I'm not sure how I can import external libraries to parse my contract events, or to be more accurate, to reuse my own typings to avoid recoding logic using the generated types. FWIW, I inspected @sistemico 's subgraph-toolkit, and noticed everything was coded from scratch. Even @PaulRBerg 's sablier subgraph's, @pi0neerpat's superfluid subgraph's and @austingriffith's scaffold-eth demo subgraph relies only on automatically generated schema, so it might be safe to say that for most cases you do not need an external library. As a conclusion, would it be fair to say that,
For now I'll go ahead and process the events using the in-house tooling. If anyone has a working example of a two-levels depth importing of a CJS compiled library to map events, it would be great. |
FWIW the documentation states that it's indeed not supporting importing other libraries. This is unrelated to the original issue, but might be enough for googlers that find this issue useful. |
I am having this problem too but with I don't understand why it doesn't just get it from node modules. But even if I specifically point to node modules, it will have a similar problem for imports within the node module files. |
Description
I followed the tutorial and I made it work with the example subgraph, but I encountered the following error when I switched to a monorepo maintained with lerna + yarn workspaces:
Of course, I made sure I have all the dependencies installed and I confirmed by that by looking into the node_modules folder at the root of the repo. I suspect that's actually why the CLI tool is complaining: it can't resolve higher-up node_modules!
EthereumTupple Error
I tried to manually copy over the libraries:
That indeed changed the output, but I got the error I documented in this comment.
Environment
Also tried downgrading the versions but had the exact same issues.
The text was updated successfully, but these errors were encountered: