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

problem building an app in production that was working in dev #1657

Open
dberardo-com opened this issue Dec 7, 2024 · 0 comments
Open

problem building an app in production that was working in dev #1657

dberardo-com opened this issue Dec 7, 2024 · 0 comments
Labels
question Further information is requested

Comments

@dberardo-com
Copy link

hi there i am playing around the o-spreadsheet project and everything works fine in dev mode. But when i build the app (tried both with webpack and vite) i get this strange error:

No active component (a hook function should only be called in 'setup')

i am trying to mount the owl component using the "rootApp" strategy shown in the main.js file of the demo folder. here the relevant code:

 const rootApp = new owl.App(Spreadsheet, { props: { model } });
 rootApp.addTemplates(templates);
 rootApp.mount(document.body, {});

i have tried to move the 2 hooks "useRef("spreadsheet");" and "useSpreadsheetRect();" in Spreadsheet component inside the setup() function but still get this error.

this same code use to work in v16 ...


Notice that everything works fine in development mode, but does not in the build version ... any hint this might be ?

NOTE: the app was working fine in both environments in version 16 of the spreasheet (owl 2.1) now i get the problem in v18 (owl 2.3)

i have reported the issue here but i believe it could be related to owl as well: odoo/o-spreadsheet#5293

@sdegueldre sdegueldre added the question Further information is requested label Dec 31, 2024
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