-
Notifications
You must be signed in to change notification settings - Fork 100
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
help: ERROR Cannot read property 'observable' of undefined #415
Comments
@l2D It seems unlikely this is an isue with this library. From the error message, I would try again after adding |
Thank you for your reply and suggestion, @danielroe. Unfortunately, it's still got the same error in Local. (From my first post, I'm wrong for telling you that the local work fine. It's work fine when in
|
@l2D In that case could you provide a reproduction? 🙏 (I'd actually suggest you provide it to |
Hi @danielroe , I am getting the same error message in my project when I run My setup is a bit different than the op's however the error message is the same so the two might be related. I have two packages... one is a library of components built using This works great when I run a dev build using
If you don't think this is related to this issue then I am happy to create a new issue with more details about my package setup. Thanks for all your hard work for the community with the package! |
Hello @danielroe and @emiller12, I try to use
Thank you. |
Could either of you provide a reproduction repository? |
Hi @danielroe sorry about the slow reply. Living is Australia means we are a bit out of sync with the rest of the world! 😂 I have managed to recreate the issue in some new bare bones repos. I have created a simple vue component library that just exports one dropdown component, and also a simple nuxt app that has two pages. One page imports the dropdown component and the other page does not. As expected the page with the external page fails when running a Full Static generation. But the page without the external component gets generated fine. If I set Links to the repos are below. I have included a Thanks for your help. Let me know if you require any more details or have any other questions. Sample Library: https://github.com/emiller12/sample-vue-library |
@emiller12 No apology necessary, and many thanks for the reproduction. I'll check later, but does adding your library to EDIT: confirmed - adding either |
Thank you @danielroe . I add
|
Can confirm that fixed the error in my actual project repo as well. Thanks heaps for looking into that @danielroe Glad your issue is resolved as well @l2D |
@danielroe is using This is fine for libraries with build modules as they can add the transpile option themselves but I think it would be beneficial to figure out a way to hint library developers on how they can solve this. Maybe an explicit error + docs? |
BREAKING CHANGE: `@vue/composition-api` is no longer transpiled by default - in addition, ensure you haven't named any layout '0' Previously `@vue/composition-api` was transpiled which led to problems depending on other libraries (namely, they had to be added to `build.transpile` to work - see #429 for summary). This fixes that issue (and solves #415 properly) This uses a hack to solve that, by using a _layout_ to register Vue Composition API. (By using a key of '0' it ensures that it appears first in `Object.keys` ahead of any other layout, although users should ensure they haven't named any layout '0'.) **Key notes**: * `@vue/composition-api` is yet again a runtime dependency - so do add it separately to your `dependencies` or add it back into `build.transpile` if that's appropriate for your situation. reverts #391
BREAKING CHANGE: `@vue/composition-api` is no longer transpiled by default - in addition, ensure you haven't named any layout '0' Previously `@vue/composition-api` was transpiled which led to problems depending on other libraries (namely, they had to be added to `build.transpile` to work - see #429 for summary). This fixes that issue (and solves #415 properly) This uses a hack to solve that, by using a _layout_ to register Vue Composition API. (By using a key of '0' it ensures that it appears first in `Object.keys` ahead of any other layout, although users should ensure they haven't named any layout '0'.) **Key notes**: * `@vue/composition-api` is yet again a runtime dependency - so do add it separately to your `dependencies` or add it back into `build.transpile` if that's appropriate for your situation. reverts #391
I have a similar problem, none of the solutions here worked I added Vue to build transpile and set ssr:false but no luck TypeError: Cannot read property 'observable' of undefined I used both examples @danielroe provided
has any any got it to work ? |
@rafaelmagalhaes That example should just work. See https://codesandbox.io/s/competent-snow-ihgjy?file=/nuxt.config.js |
@danielroe thank you what worked for me was updating the I was using version 0.22 before and I also changed to the nuxt.config
i included the '/modules' at the end |
📚 What are you trying to do? Please describe.
I use nuxt-use-sound for control audio files.
At first, I can't deploy because
Can't find module @vueuse/sound
then I added@vueuse/sound
and can deploy on Google Cloud Run but It showsERROR Cannot read property 'observable' of undefined
in the log andServer error
when access to the web.It's working fine on local.
Images
🔍 What have you tried?
@vueuse/sound
to dependencies for trying to fix the deployment problem.Server error
)ℹ️ Additional context
composition-api
in project.Docker file
FROM node:14.16.0-alpineARG BUILD_ENV
RUN mkdir -p /usr/src/app
COPY package*.json /usr/src/app/
RUN cd /usr/src/app/; npm install
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN npm run build
CMD [ "npm", "run", "start" ]
The text was updated successfully, but these errors were encountered: