samuk190 / localbase

A Firebase-Style Database ... Offline!
636 stars 84 forks source link

require is not defined problem when using vite #57

Closed filigreti closed 3 months ago

filigreti commented 2 years ago

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

adnanmasd commented 2 years ago

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

AsoStrife commented 2 years ago

I'm having the same issue

AsoStrife commented 2 years ago

@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

somascope commented 2 years ago

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?

IlyasDiker commented 1 year ago

3 Nov and still same issue ?

samuk190 commented 3 months ago

3 Nov and still same issue ?

Already fixed on latest release