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

Introduce complexity #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Introduce complexity #1

wants to merge 12 commits into from

Conversation

abrkn
Copy link

@abrkn abrkn commented Dec 13, 2019

I've added some changes to make the project look more like what a production setup would. Still needs storybook. The linting is quite basic.

@abrkn
Copy link
Author

abrkn commented Dec 14, 2019

I'm currently stuck on making the "api" node process start:

yarn build && yarn workspace @mono/api start
...
yarn workspace v1.19.1
yarn run v1.19.1
$ node --experimental-modules dist/index.js
(node:99775) ExperimentalWarning: The ESM module loader is experimental.
internal/modules/esm/default_resolve.js:84
  let url = moduleWrapResolve(specifier, parentURL);
            ^

Error: Cannot find module /Users/andreas/Repos/ts-monorepo-project-references-example/packages/shared/dist/math imported from /Users/andreas/Repos/ts-monorepo-project-references-example/packages/shared/dist/index.js
    at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:84:13)
    at Loader.resolve (internal/modules/esm/loader.js:73:33)
    at Loader.getModuleJob (internal/modules/esm/loader.js:147:40)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:41:40)
    at link (internal/modules/esm/module_job.js:40:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Ideas? Running using ts-node is not an option as it's too slow and memory intensive.

@abrkn
Copy link
Author

abrkn commented Dec 14, 2019

The solution could be to add .js to the imports, but I don't know how to do this with tsc. See https://stackoverflow.com/a/56723769/521834

@abrkn
Copy link
Author

abrkn commented Dec 14, 2019

I've abandoned esnext in favor of commonjs. There are numerous issues with esnext, both for local and third-party imports and the tsc team is nowhere close to a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant