Tincan
Tincan
Explore posts from servers
NNuxt
Created by Tincan on 10/31/2024 in #❓・help
I'm using ZAP to security test my site, but request urls are chunks, any info on this please?
pls kapa
5 replies
NNuxt
Created by Tincan on 10/23/2024 in #❓・help
nuxt/eslint doesn't recognise global helpers in plugins folder
I have a number of files in my plugins folder and nuxt/eslint module is flagging the following as undefined, even though they're not and my project still works useRuntimeConfig, defineNuxtPlugin. A workaround is to add this to config, but it seems odd (a bug?) that it can't just read these in the plugins folder when it doesn't flag as a problem for the rest of the project languageOptions: { globals: { defineNuxtPlugin: "readonly", useRuntimeConfig: "readonly", }, },
10 replies
NNuxt
Created by Tincan on 10/23/2024 in #❓・help
(fixed) Cannot get esling.config.mjs to generate when installing eslint module
I'm trying to get the nuxt/eslint module working on my nuxt 3 project. I've installed and created the eslint.config.mjs file with contents as per the docs. As far as I can tell this file it references should be created when I install the module, but i cannot get it to
import withNuxt from "./.nuxt/eslint.config.mjs"

export default withNuxt()
import withNuxt from "./.nuxt/eslint.config.mjs"

export default withNuxt()
My package.json is as follows
{
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "patch-package & nuxt prepare",
"lint": "eslint .",
"lintfix": "eslint . --fix",
"lintfixdry": "eslint . --fix-dry-run",
"format": "prettier . --write --ignore-unknown",
"prepare": "husky install",
"stylelint": "npx stylelint \"**/*.{css,scss,vue}\"",
"stylelintfix": "npx stylelint \"**/*.{css,scss,vue}\" --fix"
},
"devDependencies": {
"@nuxt/eslint": "^0.6.0",
"@nuxt/image": "^1.0.0",
"@nuxtjs/i18n": "^8.0.0-beta.10",
"@nuxtjs/stylelint-module": "^5.2.0",
"@nuxtjs/tailwindcss": "^6.6.0",
"@nuxtjs/turnstile": "^0.6.3",
"@types/markdown-it": "^12.2.3",
"@vueuse/core": "^9.13.0",
"@vueuse/nuxt": "^9.13.0",
"eslint": "^9.13.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"markdown-it": "^13.0.1",
"nuxt": "^3.2.3",
"postcss-html": "^1.7.0",
"prettier": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.11",
"sass": "^1.59.2",
"sass-loader": "^13.2.0",
"stylelint": "^16.10.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-config-tailwindcss": "^0.0.7",
"typescript": "^5.6.3"
},
...
}
{
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "patch-package & nuxt prepare",
"lint": "eslint .",
"lintfix": "eslint . --fix",
"lintfixdry": "eslint . --fix-dry-run",
"format": "prettier . --write --ignore-unknown",
"prepare": "husky install",
"stylelint": "npx stylelint \"**/*.{css,scss,vue}\"",
"stylelintfix": "npx stylelint \"**/*.{css,scss,vue}\" --fix"
},
"devDependencies": {
"@nuxt/eslint": "^0.6.0",
"@nuxt/image": "^1.0.0",
"@nuxtjs/i18n": "^8.0.0-beta.10",
"@nuxtjs/stylelint-module": "^5.2.0",
"@nuxtjs/tailwindcss": "^6.6.0",
"@nuxtjs/turnstile": "^0.6.3",
"@types/markdown-it": "^12.2.3",
"@vueuse/core": "^9.13.0",
"@vueuse/nuxt": "^9.13.0",
"eslint": "^9.13.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.0",
"markdown-it": "^13.0.1",
"nuxt": "^3.2.3",
"postcss-html": "^1.7.0",
"prettier": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.11",
"sass": "^1.59.2",
"sass-loader": "^13.2.0",
"stylelint": "^16.10.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-config-tailwindcss": "^0.0.7",
"typescript": "^5.6.3"
},
...
}
versions eslint 9.13, nuxt/eslint 0.6.0, node v20.9.0 I've tried removing and adding the eslint related packages
11 replies
NNuxt
Created by Tincan on 4/30/2024 in #❓・help
Can't import the named export 'getCurrentInstance' in ./node_modules/vue-demi/lib/index.mjs
I'm trying to reverse engineer something in a nuxt 3 site for a nuxt 2 and I want to use intersectionObserver and windowSize from @vueuse/core, which I've installed version 5.3.0 which is the latest version still compatible with Vue 2. However I get this error still
ERROR in ./node_modules/vue-demi/lib/index.mjs

Can't import the named export 'getCurrentInstance' from non EcmaScript module (only default export is available)
ERROR in ./node_modules/vue-demi/lib/index.mjs

Can't import the named export 'getCurrentInstance' from non EcmaScript module (only default export is available)
I've tried the following fix in nuxt.config.js with no success
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
},
configureWebpack: {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
],
},
},
1 replies
CDCloudflare Developers
Created by Tincan on 4/10/2024 in #pages-help
service worker not being served on live (CF Pages) but is locally
No description
6 replies
NNuxt
Created by Tincan on 4/8/2024 in #❓・help
Service worker loaded by PWA causing constant reload
I have a service worker loaded by the @vite-pwa/nuxt plugin config in nuxt.config.ts which handles push notifications as well as offline install. This all works initially, but once loaded if I reset notification sin the browser this sometimes cause some issue where the site constantly reloads. Initially it says
workbox-b5f7729d.js:61 workbox Precaching 1 file.
workbox-b5f7729d.js:61 workbox Precaching 1 file.
But then when resetting notifications, in the console it says this and triggers a constant reload situation
workbox-b5f7729d.js:61 workbox Precaching 0 files. 1 file is already cached.
workbox-b5f7729d.js:61 workbox Precaching 0 files. 1 file is already cached.
Eventually it does seem to resolve itself (stop reloading) but is there a way I can stop it having to refresh so much - if the file is already cached, proceed rather than reload The config is
pwa: {
...
workbox: {
navigateFallback: "/",
importScripts: ['/offline-sw.js'],
},
devOptions: {
enabled: true,
type: "module",
},
},
pwa: {
...
workbox: {
navigateFallback: "/",
importScripts: ['/offline-sw.js'],
},
devOptions: {
enabled: true,
type: "module",
},
},
50 replies
NNuxt
Created by Tincan on 4/3/2024 in #❓・help
How to set meta theme-color in nuxt.config
app: {
head: {
...
meta: [{
theme_color: '#ffffff',
}],
},
},
app: {
head: {
...
meta: [{
theme_color: '#ffffff',
}],
},
},
Why isn't theme_color or theme-color valid? What can I set here?
35 replies
NNuxt
Created by Tincan on 3/27/2024 in #❓・help
Why isn't window.addeventListener working in plugin file?
// eslint-disable-next-line
export default defineNuxtPlugin((nuxtApp) => {
if ("serviceWorker" in navigator) {
console.log(" sw-register.js inside if")

window.addEventListener("load", () => {
console.log("sw-register.js inside addevent listener")

// try {
// await navigator.serviceWorker.register("/sw.js")
// console.log("Registered SW")
// } catch (error) {
// console.log(error)
// }
})
}
})
// eslint-disable-next-line
export default defineNuxtPlugin((nuxtApp) => {
if ("serviceWorker" in navigator) {
console.log(" sw-register.js inside if")

window.addEventListener("load", () => {
console.log("sw-register.js inside addevent listener")

// try {
// await navigator.serviceWorker.register("/sw.js")
// console.log("Registered SW")
// } catch (error) {
// console.log(error)
// }
})
}
})
I have this file sw-register.js being loaded as a plugin and I see the "inside if" console log, but not the "inside addevent listener". I have confirmed that window exists, but it does not appear to have the addEventListener function listed in the console. Any ideas?
4 replies
CDCloudflare Developers
Created by Tincan on 3/6/2024 in #pages-help
Website domain stuck at verifying but subdomains working
I have a Pages project and I'm trying to add a domain to it. So the site has been added under Websites, but when I add this under Custom Domains in the Pages section it stays at verifying. It says 'Active' and 'data will be available here once available' I have another existing domain, which I can added as a subdomain for this pages and that verifies fine eg aaa.website.com
4 replies
RRailway
Created by Tincan on 12/14/2023 in #✋|help
Wrong PHP version after migrating database
Deployment was working fine, but I migrated the DB to v2. I get this issue in the Deploy Logs. I don't know where its being set to 3.11.5 or how to set it to anything else. It also seems strange that this wasn't an issue on DB v1 but is now on v2...
35.07 Node.js configure: Found Python 3.11.5...

35.07 Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6 or python3.5 or python2.7.
35.07 Node.js configure: Found Python 3.11.5...

35.07 Please use python3.10 or python3.9 or python3.8 or python3.7 or python3.6 or python3.5 or python2.7.
25 replies
CDCloudflare Developers
Created by Tincan on 7/20/2023 in #workers-help
How do I set the path to an image from a CF function?
I have a vue/nuxt project with files like this? assets -img --logo.svg functions -cf --contact.js and in contact.js some html embed (to style an email). How do I include the logo.svg in the html/email? htmlContent: <html><head></head><body> <img src="url('~assets/img/logo.jpg" alt="site logo"> <h1>Heading</h1>
1 replies
CDCloudflare Developers
Created by Tincan on 3/1/2023 in #workers-help
How to use env variables in a pages function locally and live (updated title)
Hi I have a function in /functions/cf/check-password.js which contains basic
export function onRequest(context) {
return new Response('Hello, world!')
}
export function onRequest(context) {
return new Response('Hello, world!')
}
and I'm trying to call it with
await this.$axios.post('http://localhost:3000/cf/check-password')
await this.$axios.post('http://localhost:3000/cf/check-password')
and I'm getting 404. How do I call this function / file using "npx wrangler pages dev -- yarn dev" to run locally
60 replies