-
-
Notifications
You must be signed in to change notification settings - Fork 599
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
Unable to resolve circular reference #130
Comments
There are a litany of circular reference issues in the main rollup project. The likelihood that there's a good solution for this is pretty slim. |
Yeah I understand that. I wasn't able to recreate using ES modules so I'm fairly certain that the createCommonjsModule code is the culprit here. I can see from looking at it that it's probably very hard to fix. |
This case comes down to an ordering issue. |
@matthewp I'm curious... Would it work if you first imported the schema.js and then imported the main joi entrypoint? |
From #164: How Do We Reproduce?Using @rollup/plugin-commonjs with Here is a complete example: https://glitch.com/edit/#!/mapgrid-rollup-postcss-repro?path=rollup.config.js:1:0 And a repo: https://github.com/mapgrid/rollup-postcss-repro/ Build log
Runtime error
Where |
@Haringat It might very well, but as I had to switch to webpack for this project I am not able to test and confirm that at this time. |
Hey folks, this one has gone quite stale. We're going to close for housekeeping but we'd happily review any PRs that pop up to resolve this issue. |
This comment has been minimized.
This comment has been minimized.
Please don't reply with "me too" or "same" posts. Instead, use the reaction buttons on the original post. |
@shellscape Hopefully this isn't considered a "me too", but... I'm not sure exactly what to do here. I'm trying to use Snowpack+Rollup for the first time and ran into this with zod. The issue is likely the same or very similar to this issue. Unless I'm missing something, there are still issues with circular dependencies in the rollup commonjs plugin which are known. The only workaround appears to be to change the package being rolled up to work around the circular dependencies (which involves quite a bit of work in 3rd party code in some instances). Are there plans to revisit this? Would another issue with a different repro help? I highly doubt my single 👍 on a closed issue will make a difference, so I hope you don't mind me chiming in with a little more context here. Thanks! |
well, there is #658 (searching for the win) |
That's great, thanks. And now there's a reference for folks who only searched issues and not PRs like myself. |
How Do We Reproduce?
https://gist.github.com/matthewp/59dd4e4f53d1d697168d67a97d9a9867
The above gist contains a minimal example. You can run:
To run rollup. Then open
smoke.html
in any web browser.Expected Behavior
Expect the code to run without error.
Actual Behavior
An error accessing the
joi.object()
function. The circular reference is not handled in the commonjs plugin.The text was updated successfully, but these errors were encountered: