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

Conversation

Projects
None yet
3 participants
@wubzz
Copy link
Collaborator

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.

Fix fs-migrations breaking docs
`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);

This comment has been minimized.

Copy link
@kibertoad

kibertoad Jan 31, 2019

Collaborator

Import above doesn't break already?

This comment has been minimized.

Copy link
@wubzz

wubzz Jan 31, 2019

Author Collaborator

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

This comment has been minimized.

Copy link
Collaborator

elhigu commented Jan 31, 2019

Related to #3022

@wubzz wubzz merged commit e7c674e into master Jan 31, 2019

2 of 3 checks passed

coverage/coveralls Coverage decreased (-0.08%) to 85.122%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.