Skip to content
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

error: recursion limit reached while expanding the macro stringify #155

Closed
dbkaplun opened this issue Feb 22, 2018 · 3 comments
Closed

error: recursion limit reached while expanding the macro stringify #155

dbkaplun opened this issue Feb 22, 2018 · 3 comments

Comments

@dbkaplun
Copy link

dbkaplun commented Feb 22, 2018

It may help to rewrite the html or stringify macros in an iterative fashion to avoid recursion limits.

Repro:

$ git clone git@github.com:dbkaplun/solve24-rs.git
$ cd solve24-rs/solve24-web
$ git checkout stringify-recursion-repro
$ npm install && npm run parcel:build
npm WARN bootstrap@4.0.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.0.0 requires a peer of popper.js@^1.12.9 but none is installed. You must install peer dependencies yourself.

up to date in 6.078s

> solve24-rs@1.0.0 parcel:build /Users/dbkaplun/solve24-rs/solve24-web
> COMMAND=build npm run parcel


> solve24-rs@1.0.0 parcel /Users/dbkaplun/solve24-rs/solve24-web
> export OUT_DIR='../p' PUBLIC_URL='/solve24-rs/p' && rm -rf $OUT_DIR && parcel $COMMAND index.html --out-file=index.html --out-dir=$OUT_DIR --public-url=$PUBLIC_URL

⏳  Building Cargo.toml...
🚨  /Users/dbkaplun/solve24-rs/solve24-web/Cargo.toml: Compilation failed!
warning: debug builds on the wasm32-unknown-unknown are currently totally broken
         forcing a release build
   Compiling solve24-web v1.0.0 (file:///Users/dbkaplun/solve24-rs/solve24-web)
error: Could not compile `solve24-web`.

error: recursion limit reached while expanding the macro `stringify`
   --> src/main.rs:133:30
    |
133 |                           _ => html! {
    |  ______________________________^
134 | |                             <table class="table",>
135 | |                                 <thead>
136 | |                                     <th scope="col",>{"#"}</th>
...   |
141 | |                             </table>
142 | |                         },
    | |_________________________^
    |
    = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: build failed
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! solve24-rs@1.0.0 parcel: `export OUT_DIR='../p' PUBLIC_URL='/solve24-rs/p' && rm -rf $OUT_DIR && parcel $COMMAND index.html --out-file=index.html --out-dir=$OUT_DIR --public-url=$PUBLIC_URL`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the solve24-rs@1.0.0 parcel script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dbkaplun/.npm/_logs/2018-02-22T01_14_58_918Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! solve24-rs@1.0.0 parcel:build: `COMMAND=build npm run parcel`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the solve24-rs@1.0.0 parcel:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dbkaplun/.npm/_logs/2018-02-22T01_14_58_978Z-debug.log
@koute
Copy link
Contributor

koute commented Feb 23, 2018

I think this will have to wait until Rust finally stabilizes procedural macros. (The js! macro from stdweb has exactly the same problem.) Fortunately having to add the #![recursion_limit="128"] is not really a big deal.

@madmaxio
Copy link

An what is this recursion thing and why it hapeens? Having it while adding more tags to template.

@jstarry
Copy link
Member

jstarry commented Aug 14, 2019

Close in favour of #590

@jstarry jstarry closed this as completed Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants