Skip to content

Sample project to reproduce the bundle issue with `typedorm` library

Notifications You must be signed in to change notification settings

typedorm/typedorm-bundle-issue

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample project to reproduce the bundle issue with typedorm library

Steps to reproduce issue with webpack

Install dependencies:

npm install

Compile project

npm run build

Bundle project

npm run bundle

The above commands results in a lot of warnings such as:

WARNING in ./node_modules/@typedorm/common/index.js 13:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./dist/src/index.js 6:17-44

WARNING in ./node_modules/@typedorm/common/private-api.js 13:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./node_modules/@typedorm/common/index.js
 @ ./dist/src/index.js 6:17-44

WARNING in ./node_modules/@typedorm/common/public-api.js 13:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./node_modules/@typedorm/common/index.js
 @ ./dist/src/index.js 6:17-44

WARNING in ./node_modules/@typedorm/common/src/constants.js 3:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./node_modules/@typedorm/common/public-api.js
 @ ./node_modules/@typedorm/common/index.js
 @ ./dist/src/index.js 6:17-44
 
 ...

Run the generated bundle

node dist/bundle/index.js

The above command errors:

/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:3458
	throw e;
	^

Error: Cannot find module '@typedorm/common/public-api'
    at webpackEmptyContext (/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:3456:10)
    at /private/tmp/typedorm-bundle-issue/dist/bundle/index.js:1082:18
    at /private/tmp/typedorm-bundle-issue/dist/bundle/index.js:1070:17
    at Object../node_modules/@typedorm/common/index.js (/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:1079:3)
    at __webpack_require__ (/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:23562:42)
    at Object../dist/src/index.js (/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:16:18)
    at __webpack_require__ (/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:23562:42)
    at /private/tmp/typedorm-bundle-issue/dist/bundle/index.js:23626:37
    at Object.<anonymous> (/private/tmp/typedorm-bundle-issue/dist/bundle/index.js:23628:12)
    at Module._compile (internal/modules/cjs/loader.js:1085:14) {
  code: 'MODULE_NOT_FOUND'
}

About

Sample project to reproduce the bundle issue with `typedorm` library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 57.2%
  • JavaScript 42.8%