Alan
Alan
NNuxt
Created by Alan on 9/28/2024 in #❓・help
NSFWjs and Vite/Nuxt
Before you read: (It's probably more of a package issue, but I need it to work with Nuxt and Vite) I need it done asap and can offer a small tip Has anyone used the nsfwjs https://www.npmjs.com/package/nsfwjs package with nuxt? I am having issue in my Nuxt 3 (with spa mode) project. I believe the problem is related to Vite because the package works correctly in a barebone React project as per the documentation. In particular: with the following imports as per docs
import * as tf from "@tensorflow/tfjs";
import * as nsfwjs from "nsfwjs";
import * as tf from "@tensorflow/tfjs";
import * as nsfwjs from "nsfwjs";
It throws an error right after this line: const model = await nsfwjs.load("MobileNetV2Mid");
nsfwjs.js?v=0f6cacb3:217 Uncaught (in promise) Error: Could not load the model. Make sure you are importing the model.min.js bundle.
at nsfwjs.js?v=0f6cacb3:217:17
at step (nsfwjs.js?v=0f6cacb3:110:17)
at Object.next (nsfwjs.js?v=0f6cacb3:62:14)
at nsfwjs.js?v=0f6cacb3:49:67
at new Promise (<anonymous>)
at __awaiter (nsfwjs.js?v=0f6cacb3:31:10)
at loadModel (nsfwjs.js?v=0f6cacb3:195:10)
at Module.<anonymous> (nsfwjs.js?v=0f6cacb3:249:22)
at step (nsfwjs.js?v=0f6cacb3:110:17)
at Object.next (nsfwjs.js?v=0f6cacb3:62:14)
nsfwjs.js?v=0f6cacb3:217 Uncaught (in promise) Error: Could not load the model. Make sure you are importing the model.min.js bundle.
at nsfwjs.js?v=0f6cacb3:217:17
at step (nsfwjs.js?v=0f6cacb3:110:17)
at Object.next (nsfwjs.js?v=0f6cacb3:62:14)
at nsfwjs.js?v=0f6cacb3:49:67
at new Promise (<anonymous>)
at __awaiter (nsfwjs.js?v=0f6cacb3:31:10)
at loadModel (nsfwjs.js?v=0f6cacb3:195:10)
at Module.<anonymous> (nsfwjs.js?v=0f6cacb3:249:22)
at step (nsfwjs.js?v=0f6cacb3:110:17)
at Object.next (nsfwjs.js?v=0f6cacb3:62:14)
Does anyone have any idea how to fix that package or make vite import .js files correctly?
1 replies
NNuxt
Created by Alan on 9/15/2024 in #❓・help
`Help center`
Guys, I want to build a Help Center (a page where users find answers to questions like how to log in, block a user, UI questions, terms of service, privacy etc.) with Nuxt 3, and I have the following requirements: i18n support Markdown file based with directory support tree (content/en/troubleshooting/how-to-disable-x.md) Search articles by title or description Is there any Nuxt 3 module that would allow me to build this as fast as possible? I looked at @nuxt/content, but it seems very complex bad choice, even from the docs -_-. So, I’m not sure what the least time consuming approach would be, without wasting time reinventing the wheel...
8 replies