Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Has Anyone Found Solution To This Bug! #1207

Closed
SemAiSoft opened this issue Dec 9, 2024 · 6 comments
Closed

Has Anyone Found Solution To This Bug! #1207

SemAiSoft opened this issue Dec 9, 2024 · 6 comments

Comments

@SemAiSoft
Copy link

SemAiSoft commented Dec 9, 2024

This fs module error has kept me away from using this wonderful Library since its version 0.23.0. It won't allow project or library build.
I am on a fresh Angular 18 esbuild (vite) project, stil errors as shown below:

Screenshot from 2024-12-10 00-12-16

@maxnowack
Copy link
Owner

It seems your screenshot upload wasn't complete at the time you posted your comment.
Do you mean the same issue as in #988? Could you provide a minimal reproduction repo?

@SemAiSoft
Copy link
Author

It seems your screenshot upload wasn't complete at the time you posted your comment. Do you mean the same issue as in #988? Could you provide a minimal reproduction repo?

Sorry, I just fixed the screenshot. ANd yes, as in issue #988 - just that this is not warning but an error stopping project build.

@maxnowack
Copy link
Owner

Your screenshot indicates that you use the filesystem persistence adapter somewhere on client side. Could you provide some code where you initialize your collection and adapters?

@SemAiSoft
Copy link
Author

Your screenshot indicates that you use the filesystem persistence adapter somewhere on client side. Could you provide some code where you initialize your collection and adapters?

My code in Angular service is as simple as below, meanwhile I try a Stabliz repro and get back to. THANKS.

@Injectable({
    providedIn: 'root'
})
export class DesignStoreService{
    readonly store: Collection<ICDesignData>;
    userProjects: ICDesignData[] = [];

    constructor() {  
            
        this.store = new Collection({
            persistence: createLocalStorageAdapter('cdesign-store'),
            reactivity: angularReactivityAdapter,
            indices: [
                createIndex('id'),
                createIndex('userId'),
            ]
        });

    }
}

@maxnowack maxnowack mentioned this issue Dec 10, 2024
Merged
10 tasks
@SemAiSoft
Copy link
Author

Your screenshot indicates that you use the filesystem persistence adapter somewhere on client side. Could you provide some code where you initialize your collection and adapters?

Well, I have found a work around in the meantime until fix, or browser browser file to import. The fix is the option:

"externalDependencies": ["fs"]

in build section of Angular/project .json.
Smiles, I just prefer this project over Dexie, RxDb, etc. Far simpler, cleaner and straightforward in its implementation.
Thanks for the Good Work.

@maxnowack
Copy link
Owner

I see. Then let's close this one a it is the same issue as discussed in #988. I'm currently preparing v1.0.0 which splits out the persistence adapters and therefore eliminates this error 🙂
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants