wanderlust icon indicating copy to clipboard operation
wanderlust copied to clipboard

[BUG] Changing the file extension from .ts to .js

Open kamnajain06 opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

Currently all the files are having .ts extension but they have been imported with .js extension, because of this the system is unable to fetch the required file due to mismatch of the file names.

Expected Behavior

The extension of the file name and the imported files should be same.

Reproduction steps

1. install node
2. Run npm i
3. See error

Screenshots

Screenshot 2024-10-28 at 12 31 48 AM

Logs

kamnajain06@ubuntu:~/git_demo/wanderlust/backend$ npm run dev

> dev
> nodemon server.js

[nodemon] 3.1.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node server.js server.js`
node:internal/modules/cjs/loader:1249
  throw err;
  ^

Error: Cannot find module '/home/kamnajain06/git_demo/wanderlust/backend/server.js'
    at Function._resolveFilename (node:internal/modules/cjs/loader:1246:15)
    at Function._load (node:internal/modules/cjs/loader:1072:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:216:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
    at node:internal/main/run_main_module:36:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v23.1.0

Browsers

No response

OS

Linux

kamnajain06 avatar Oct 27 '24 19:10 kamnajain06

as per the README.md, the maintainer provided with this link https://github.com/krishnaacharyaa/wanderlust/blob/main/.github/CONTRIBUTING.md#setting-up-the-project

that has a package.json with npm run installer script defined in it to handle both frontend & backend but after executing this command vite is not recognized in frontend and requires npm i --legacy-peer-deps to get that issue resolved then npm run dev runs the frontend successfully.

The backend needs DB Compass with the import of dummy data provided in the backend data folder and redis running in local machine. As DB and Redis are called while running server. To run backend, I first installed ts-node and typescript as backend has .ts file but scripts in package.json of backend needs server.js which is not there. npm start can not directly run the .js file.

I compiled .ts to .js by npx tsc command than I changed package.json, and modified start script to "node dist/server.js" this started the server.

Redis and DB compass with wanderlust db > posts collection > sample_posts.json import are required*

Also Google Client id needs to be set in backend .env (in backend run cp .env.sample .env). This can be random.

chandrikaHarsha avatar Mar 13 '25 05:03 chandrikaHarsha

@kamnajain06 can I work on this issue..

RaghavRR avatar May 01 '25 04:05 RaghavRR