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

Add support for Nuxt #11

Open
Rednas83 opened this issue Aug 27, 2021 · 8 comments
Open

Add support for Nuxt #11

Rednas83 opened this issue Aug 27, 2021 · 8 comments
Labels
backlog Queued in backlog bug Something isn't working good first issue Good for newcomers spring cleaning Could be cleaned up one day

Comments

@Rednas83
Copy link

Describe the Bug

During import of vue-bpmn the application crashes. Is the package also compatible with nuxt?

Environment

  • Node v14.17.5
  • Windows 10
  • nuxt v2.15.8 (latest version)
  • bpmn-js
    -> Tried v8.72 (latest version)
    -> And v3.2.3 (example version)
@Rednas83 Rednas83 added the bug Something isn't working label Aug 27, 2021
@nikku
Copy link
Member

nikku commented Aug 27, 2021

Please share a CodeSandbox that reproduces the issue reliably.

@Rednas83
Copy link
Author

Hereby
https://codesandbox.io/s/kind-danilo-8f79r?file=/pages/index.vue

I commented out the script in index.vue to avoid the crashing.

@nikku
Copy link
Member

nikku commented Aug 30, 2021

Thanks for the sandbox. I can reproduce your issue.

Not sure what is going on there specifically but I assume it is due to the fact that vue-bpmn does not support server-side rendering, a thing that nuxt claims it does.

Due to the nature of the underlying library we won't support that any time soon, too.

How do you design nuxt components to work gracefully, client-side only?

@Rednas83
Copy link
Author

For some reason nuxt tries to run some of the script in the server.
You can avoid this by:

  • lazy load your client component const form = () => import('...')
  • move your client code into the mounted() hook
  • wrap your client code inside an if(process.client) statement

Usually this requires only very small changes to make it suitable for server side rendering.

See also https://deltener.com/blog/common-problems-with-the-nuxt-client-only-component/ for more information.

@nikku
Copy link
Member

nikku commented Aug 30, 2021

Happy to accept a PR to get this thing nuxt ready. Why not.

@nikku nikku added pr welcome We rely on a community contribution to improve this. backlog Queued in backlog labels Aug 30, 2021
@Rednas83 Rednas83 changed the title Crashes on import Add support for Nuxt Sep 11, 2021
@Rednas83
Copy link
Author

Rednas83 commented Oct 9, 2021

I don't think I will have time to create a PR for this any time soon.

  • If anyone is interested feel free to work on it✌
  • Also because of the underlying libraries (125 repositories in bpmn-io) as mentioned by @nikku I am not to exited to get started. Perhaps something for the team?

@nikku
Copy link
Member

nikku commented Oct 11, 2021

Thanks for your feedback. Will move this one to the backlog.

@nikku
Copy link
Member

nikku commented Oct 11, 2021

Also adding good first issue to this one. Lazy loading the client-side only part should be something that is absolutely doable.

@nikku nikku added good first issue Good for newcomers spring cleaning Could be cleaned up one day and removed pr welcome We rely on a community contribution to improve this. labels Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog bug Something isn't working good first issue Good for newcomers spring cleaning Could be cleaned up one day
Development

No branches or pull requests

2 participants