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

run dev works but run build gives an error #17

Open
Nrde opened this issue Mar 16, 2021 · 3 comments
Open

run dev works but run build gives an error #17

Nrde opened this issue Mar 16, 2021 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@Nrde
Copy link

Nrde commented Mar 16, 2021

When I run a dev build on my localhost there's no errors, but when I try to build the project I get errors from every extra rule/check/enrichment I have made. My Javascript fu isn't that strong so be gentle...

> svelte-app@1.0.0 build
> routify -b && rollup -c && routify export && workbox injectManifest

[Routify] Generated routes in 7 ms

src/main.js → dist/build/bundle.js...
  5024 |        let t53;
  5025 |        let span10;
> 5026 |        let t54_value = (/*$enrichment*/ ctx[2]?.description?.contentLength || 0) + "";
       |                                               ^ Unexpected token: punc (.)
  5027 |        let t54;
  5028 |        let t55;
  5029 |        let t56;
@Nrde
Copy link
Author

Nrde commented Mar 16, 2021

the above is triggered by

enrich: {
      description: {
        contentLength: (value) => value.length
      }
    }

@tanepiper tanepiper self-assigned this Mar 17, 2021
@tanepiper tanepiper added the question Further information is requested label Mar 17, 2021
@tanepiper
Copy link
Owner

Hi @Nrde is this also on Firefox? the ?. operator is new in JavaScript, but all the modern browsers should support it - although this is actually the svelte compiled app as far as I can see, so Rollup should be building it for your environment

@Nrde
Copy link
Author

Nrde commented Mar 17, 2021

I mean when doing local development, doing "npm run dev" there's no errors and the app works just fine on localhost:5000

When doing "npm run build" I get the console log mentioned above. I just commented out all validators, enrich blocks and don't use them with the form fields to be able to compile the stuff.

But I seem to have so many other problems with the new routify so I'm not sure which part of my dev environment to blame anymore. If I find out what goes wrong I'll get back to this problem. So maybe I have to blame Routify for everything, it's a pita at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants