Comments (9)
@SuslegStyle fixed in the latest release, see https://www.youtube.com/watch?v=ybCMaNDcb1s
from fastify-vite.
I found reasons, why this error happens for me, maybe for someone else it will be helpful.
The root cause is Vue version, for 3.1.2 the error is happens, but when I downgraded back to 3.1.1 the error is gone.
The changelog can be found here
from fastify-vite.
Thank you for the update.
I made the appropriate changes, but it does not work me.
TypeError: Cannot read property 'appContext' of null
at useGlobalProperties (***\node_modules\fastify-vite-vue\client.js:111:30)
at Proxy.useHydration (***\node_modules\fastify-vite-vue\client.js:35:23)
at setup (***/pages/index.vue:73:34)
The error points to useGlobalProperties
method. getCurrentInstance
returns null and I don't know why.
function useGlobalProperties () {
return getCurrentInstance().appContext.app.config.globalProperties
}
I tried to use different combination of Vue and Vite versions, but no luck.
The current list of my dependencies
"dependencies": {
"@popperjs/core": "^2.9.2",
"@vueuse/head": "^0.6.0",
"async": "^3.2.0",
"awilix": "^4.3.4",
"bootstrap": "^5.0.2",
"bootstrap-icons": "^1.5.0",
"fastify": "^3.19.2",
"fastify-api": "^0.2.0",
"fastify-awilix": "^1.1.0",
"fastify-config-loader": "^1.1.2",
"fastify-cookie": "^5.3.1",
"fastify-plugin": "^3.0.0",
"fastify-sensible": "^3.1.1",
"fastify-session": "^5.2.1",
"fastify-vite": "^2.2.0-beta.5",
"fastify-vite-vue": "^2.2.0-beta.5",
"fluent-json-schema": "^3.0.1",
"vite": "^2.4.3",
"vue": "^3.1.5",
"vue-router": "^4.0.10",
"vue3-resize": "^0.2.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.2.5",
"@vue/compiler-sfc": "^3.1.5",
"chai": "^4.3.4",
"cross-env": "^7.0.3",
"eslint": "^7.31.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-vue": "^7.14.0",
"faker": "^5.5.3",
"mocha": "^9.0.2",
"sass": "^1.35.2"
}
from fastify-vite.
A small update,
I tried to call directly
const internalInstance = getCurrentInstance();
console.log(internalInstance);
const ctx = await useHydration({getData});
And I can see an object in console, but still have an issue inside useHydration
TypeError: Cannot read property 'appContext' of null
from fastify-vite.
Can you put up a reproduction repository?
from fastify-vite.
Yeah, it is great idea.
Here you go, https://github.com/SuslegStyle/fastify-vite-hello-world
I will be really appreciate if you can help me to understand what exactly is wrong.
from fastify-vite.
@galvez any updates ? Does the example was helpful?
from fastify-vite.
It has been fixed starting fromfastify-vite: 2.2.0-beta.9
from fastify-vite.
Thanks for closing the issue, @SuslegStyle!
from fastify-vite.
Related Issues (20)
- Files in /public folder are not served in production mode HOT 4
- Error on Windows: TypeError: Cannot read properties of null (reading 'replace')
- Websocket can not connect when using https fastify
- If vites config contains `defineConfig` with callback, then SSR is broken HOT 3
- How to configure multi-page entry
- Issues running with fastify-compress HOT 4
- Serve static assets from ssr builds in production mode HOT 2
- TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string
- Trace: The CJS build of Vite's Node API is deprecated
- Conflicting websockets between vite and `@fastify/websocket` causing infinite redirects HOT 1
- [react][windows] React Starter Template does not start on Windows HOT 4
- How to use Vue plugins like instance.use(...) HOT 4
- NPM install fails with 'edgesout' error HOT 3
- [SPA] allowing passing additional context to the render function HOT 3
- mts file extension is not supported for vite.config HOT 3
- @fastify/vue Smart Import doesn't resolve path in windows HOT 5
- How to config fastify-vite in a Electron Vite project HOT 1
- Route path resolution of starters/react-base not working in Windows
- Unable to build project and missing files
- Missing `fastify-plugin` dependency
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify-vite.