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

Starting the app throws an error (Ubuntu) #89

Closed
claudesortwell opened this issue Apr 22, 2021 · 4 comments · Fixed by #95
Closed

Starting the app throws an error (Ubuntu) #89

claudesortwell opened this issue Apr 22, 2021 · 4 comments · Fixed by #95
Assignees
Labels
🐞 Bug Something isn't working

Comments

@claudesortwell
Copy link

Describe the Bug(버그 설명)

Anytime you tired to npm start (or run the built server), it would fail with:

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module './'
Require stack:

Version to Reproduce(현재 사용한 버전)

Ubuntu 20.04, Node v12.22.1, npm v6.14.12

Steps to Reproduce(재현 순서)

  1. Start a new project with Prisma
  2. Run npm install
  3. Run npm start

Expected Behavior(예상 동작)

Its expected to start the server up on port 3000 but fails.

Actual Behavior(실제 동작)

Fails and quits server.

Additional Context(추가 사항)

I fixed this by changing line 4 of server.ts from:

import App from '@app';

to:

import App from './app';

Capture screen(캡쳐 화면)

image

@claudesortwell claudesortwell added the 🐞 Bug Something isn't working label Apr 22, 2021
@ljlm0402
Copy link
Owner

@claudesortwell

Thank you for leaving the bug issue.

After confirming this issue, we will take action.

@chrisurlaub
Copy link

I experienced the same issue using node v15.13.0 and after I switched to v13.11.0 everything worked well.

(though I had to install package "pg" manually to work with sequelize and postgresql)

@timothystewart6
Copy link

The same happens for me after a build. It also happens when putting it in a docker container. I am using node 14.16.1

@timothystewart6
Copy link

timothystewart6 commented May 2, 2021

I think I made some progress. It seems like it might be tsc-alias which I haven't used before but I can see how it's convenient. I replaced all aliases with relative imports and built, then passed in variables manually as a test. The app started from the transpiled version immediately.

NODE_ENV=development PORT=3000 node server.js
2021-05-02 00:08:48 info: =================================
2021-05-02 00:08:48 info: ======= ENV: development =======
2021-05-02 00:08:48 info: 🚀 App listening on the port 3000
2021-05-02 00:08:48 info: =================================

I would like to use tsc-alias but not sure how to build a transpiled app with it. Thanks for this by the way. it's a great starter kit.

ljlm0402 added a commit that referenced this issue May 4, 2021
- Starting the app throws an error (Ubuntu) #89
- Cannot find module './' #91
- ReferenceError: exports is not defined #94
@ljlm0402 ljlm0402 linked a pull request May 4, 2021 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants