localbase icon indicating copy to clipboard operation
localbase copied to clipboard

require is not defined problem when using vite

Open filigreti opened this issue 3 years ago • 5 comments

on installing localbase with vite after build, we get the require is not defined coming from let bt = require("ordered-uuid"); Vite doesnt support require

filigreti avatar Sep 22 '21 22:09 filigreti

@filigreti Facing the same issue. Have you found a solution?

adnanmasd avatar Mar 15 '22 08:03 adnanmasd

I'm having the same issue

AsoStrife avatar Apr 19 '22 14:04 AsoStrife

@filigreti @adnanmasd @dannyconnell I fix this problem with a line of code. Inside localbase/localbase/api/actions/add.js I changed the first line of the script with this: import UUID from 'ordered-uuid'

@dannyconnell It would be nice if you update the npm package with this fix

AsoStrife avatar Apr 19 '22 14:04 AsoStrife

I am also having this issue in a Vue/Vite project. The fix suggestion from @filigreti works well for me when I can modify the mentioned file locally. But if you are deploying remotely, where the NPM package is loaded by that service (like Netlify), this is still a problem. @dannyconnell Is this a revision you can make?

somascope avatar Jun 04 '22 20:06 somascope

3 Nov and still same issue ?

IlyasDiker avatar Nov 03 '22 14:11 IlyasDiker