jeff-zucker / solid-file-client

A Javascript library for creating and managing files and folders in Solid data stores
MIT License
55 stars 18 forks source link

Cannot find "null" module on browser version since v0.5.0 #41

Closed bourgeoa closed 3 years ago

bourgeoa commented 5 years ago

I got the following error since V0.5.0 where was introduced rdflib@0.20.1 (with solid-file-cli as webpack : externals refered as "null" module for browser usage (same being applied to solid-file-client))

Error: Cannot find module 'null' from '/volume1/homes/admin/TW5/plugins/bourgeoa/tiddlywiki-node-solid-server/node_modules/solid-file-client/dist/browser'

At the same time I tried to upgrade solid-ide to use latest version of solid-file-client. The solid-file-client never loaded.

jeff-zucker commented 5 years ago

It must be a difference in our development environments, because if I clone the current master, then run npm install, it successfully builds and I can access it from the created bundle.js. I checked this before I npm'd it and also just now.

bourgeoa commented 5 years ago

I found that webpack npm null-loader could replace an unused module by an empty module. After a lot of trial and error, I found a working solution : . as rdflib treated solid-file-cli as external and only succeed any compile keeping it external . I added a rule to use webpack null loader but it only compiled if . in external I used "solid-file-client" : "solid-file-client" in replacement of "solid-file-client" : "null" .

With that I have a solid-ide and solidTiddlywiki both using a solid-file-client compatible with rdflib@0.20.1

jeff-zucker commented 5 years ago

I have never seen the error you describe. If it is indeed a problem with how rdflib external works, then I need to fix it there, we should not be doing things to solve an error that occurs elsewhere. But, as I said, I do not get the same error as you - I have never seen that error.

bourgeoa commented 5 years ago

Here are the 2 webpack files I modified

webpack.zip

bourgeoa commented 5 years ago

The developpement environnement for solidTiddliwiki is browserify babelify For solid-ide there is no dev environnement as you only use Githubissues.

  • Githubissues is a development platform for aggregating issues.