Alasql: Does alasql work in VueJS 2/webpack/Laravel?

Created on 21 Jul 2017  路  9Comments  路  Source: agershun/alasql

So I did npm install alasql --save-dev.

Then tried require('alasql'); and import alasql from 'alasql';

But I get these errors on npm run dev with both of the above options:

These dependencies were not found:

* fs in ./node_modules/alasql/dist/alasql.fs.js, ./node_modules/request/lib/har.js
* react-native-fs in ./node_modules/alasql/dist/alasql.fs.js
* react-native-fetch-blob in ./node_modules/alasql/dist/alasql.fs.js
* net in ./node_modules/forever-agent/index.js, ./node_modules/tough-cookie/lib/cookie.js and 1 other
* tls in ./node_modules/forever-agent/index.js, ./node_modules/request/node_modules/tunnel-agent/index.js
! Question Help wanted

All 9 comments

I also tried to do npm install --save-dev fs react-native-fs react-native-fetch-blob net tls to hack my way through those missing dependencies and it still doesn't like me. :/

This dependency was not found:

* fs in ./node_modules/alasql/dist/alasql.fs.js, ./n

To install it, you can run: npm install --save fs

Silly question: have you had a look at https://github.com/agershun/alasql/wiki/readme#use-webpack-and-browserify ?

Hi @iamvitali! Thanks for filing an issue.
I wrote the above guide months ago. Seems like there has been some updates to alasql to support React Native. I'll update the documentation, but the general idea is to ignore any module you don't need or alias it to another library.

Seems like there has been some updates to alasql to support React Native

Any inputs to how AlaSQL must change to support React Native would be much appreciated!

I think it already does? The issue here is that those modules are meant for mobile development, while he is trying to target the browser (correct me if I'm wrong).

Should work now with 0.4.2

Awesome. I will close this issue, please reopen if 0.4.2 does not solve the problem.

Thanks to whoever fixed it.

All works perfectly now! :tada:

All works perfectly now! 馃帀

For React Native? I'm still getting unable to resolve module 'fs'. Looking at the source code there's still a require('fs') in dist/alasql.js, and commenting that method out made it work for me.

I wonder if the library could be somehow separated into pure in-memory methods and fs-related methods, so there's no need to wrap fs-related methods in if statements. Something like import { loadFile } from 'alasql/fs'. Correct me if i'm wrong but that would let users choose their own fs solution or even not include one to reduce their bundle size.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cscan picture cscan  路  4Comments

mathiasrw picture mathiasrw  路  5Comments

mwhebert picture mwhebert  路  3Comments

mathiasrw picture mathiasrw  路  5Comments

DickSwart picture DickSwart  路  6Comments