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

Fix fs-migrations breaking docs #3022

Merged
merged 1 commit into from Jan 31, 2019
Merged

Conversation

@wubzz
Copy link
Member

@wubzz wubzz commented Jan 31, 2019

fs does not exist in the browser, causing errors such as:

Uncaught TypeError: expecting a function but got [object Undefined]
    at Function.t.promisify (bluebird.js:4020)
    at Object.<anonymous> (fs-migrations.js:18)
    at Object.<anonymous> (fs-migrations.js:83)
    at n (bootstrap:19)
    at Object.<anonymous> (Migrator.js:21)
    at n (bootstrap:19)
    at Object.<anonymous> (make-knex.js:10)
    at n (bootstrap:19)
    at Object.<anonymous> (transaction.js:14)
    at n (bootstrap:19)
    at Object.<anonymous> (client.js:18)
    at n (bootstrap:19)
    at Object.<anonymous> (knex.js:10)
    at n (bootstrap:19)
    at Object.<anonymous> (index.js:8)
    at n (bootstrap:19)

Currently this blocks examples in docs and also viewing full changelog.

`fs` does not exist in the browser, causing errors such as: Uncaught TypeError: expecting a function but got [object Undefined]
@wubzz wubzz requested review from elhigu and kibertoad Jan 31, 2019
@@ -3,7 +3,7 @@ import path from 'path';
import Promise from 'bluebird';
import { sortBy, filter } from 'lodash';

const readDirAsync = Promise.promisify(fs.readdir, { context: fs });
const readDirAsync = (path) => Promise.promisify(fs.readdir, { context: fs })(path);

Copy link
Collaborator

@kibertoad kibertoad Jan 31, 2019

Import above doesn't break already?

Copy link
Member Author

@wubzz wubzz Jan 31, 2019

Supposedly not, that was my first thought as well. Seems it's set to empty object instead, presumably by webpack.

Edit: Yup, looks like config does this

@elhigu
Copy link
Member

@elhigu elhigu commented Jan 31, 2019

Related to #3022

@wubzz wubzz merged commit e7c674e into master Jan 31, 2019
2 of 3 checks passed
@kibertoad kibertoad deleted the bugfix/fs-migrations-breaks-documentation branch Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants