question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.2.26 brakes browser builds (by node-only PlatformTools refactoring commit)

See original GitHub issue

Issue type: [x] bug report

Database system/driver: all / browser-builds

TypeORM version: [x] 0.2.26

Steps to reproduce or a small repository showing the problem: Building a project with TypeORM 0.2.26 with webpack for a browser target leads to multiple errors, the following is just just an excerpt (with duplicates removed):

WARNING in ../node_modules/typeorm/browser/connection/ConnectionOptionsReader.js 114:45-64
Critical dependency: the request of a dependency is an expression

WARNING in ../node_modules/typeorm/browser/util/DirectoryExportedClassesLoader.js 38:38-78
Critical dependency: the request of a dependency is an expression

Module not found: Error: Can't resolve 'path'

Module not found: Error: Can't resolve 'stream'

Module not found: Error: Can't resolve 'fs'

Module not found: Error: Can't resolve 'timers'

I could track this down to this commit: https://github.com/typeorm/typeorm/commit/490ad0d424e674de5be38b0c3bc83b9a14a383a5

I reverted this commit locally and could then successfully use 0.2.26 with this modification in a browser Webpack build.

I guess that https://github.com/typeorm/typeorm/pull/6630 didn’t take browser builds into account for its refactoring. On a quick look those errors (and the code changes in the pull request) do look like node-only stuff.

I suggest reverting the commit/PR @pleerock.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:26 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
chriswepcommented, Sep 23, 2020

thanks @imnotjames - https://github.com/typeorm/typeorm/pull/6763 seems to do it. no more warnings/errors.

1reaction
pleerockcommented, Sep 19, 2020

Thanks @imnotjames @chriswep . I’ll release a new version in a few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found