I am trying to run an express app after converting to ES modules, however I am running into a path error. Below is the package & TS configs. Also below is the node entrypoint & files.
I need some feedback if I am not properly bundling path & fs
Performing pnpm run build and pnpm run start returns
node dist/index.js
file:///home/vscode/Source/test/packages/core/dist/index.js:1
var px=Object.create;var t1=Object.defineProperty;var dx=Object.getOwnPropertyDescriptor;var lx=Object.getOwnPropertyNames;var cx=Object.getPrototypeOf,ux=Object.prototype.hasOwnProperty;var O=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,a)=>(typeof require<"u"?require:e)[a]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mx=(t,e)=>{for(var a in e)t1(t,a,{get:e[a],enumerable:!0})},fx=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of lx(e))!ux.call(t,i)&&i!==a&&t1(t,i,{get:()=>e[i],enumerable:!(r=dx(e,i))||r.enumerable});return t};var La=(t,e,a)=>(a=t!=null?px(cx(t)):{},fx(e||!t||!t.__esModule?t1(a,"default",{value:t,enumerable:!0}):a,t));var wa=g((xL,I2)=>{"use strict";var hx=O("path").relative;I2.exports=xx;var vx=process.cwd();function D2(t,e){for(var a=t.split(/[ ,]+/),r=String(e).toLowerCase(),i=0;i<a.length;i++){var n=a[i];if(n&&(n==="*"||n.toLowerCase()===r))return!0}return!1}function yx(t,e,a){var r=Object.getOwnPropertyDescriptor(t,e),i=r.value;return r.get=function(){return i},r.writable&&(r.set=function(s){return i=s}),delete r.value,delete r.writable,Object.defineProperty(t,e,r),r}function gx(t){for(var e="",a=0;a<t;a++)e+=", arg"+a;return e.substr(2)}function bx(t){var e=this.name+": "+this.namespace;this.message&&(e+=" deprecated "+this.message);for(var a=0;a<t.length;a++)e+=`
^
Error: Dynamic require of "path" is not supported
at file:///home/vscode/Source/test/packages/core/dist/index.js:1:382
at file:///home/vscode/Source/test/packages/core/dist/index.js:1:882
at file:///home/vscode/Source/test/packages/core/dist/index.js:1:458
at file:///home/vscode/Source/test/packages/core/dist/index.js:20:15607
at file:///home/vscode/Source/test/packages/core/dist/index.js:1:458
at file:///home/vscode/Source/test/packages/core/dist/index.js:51:609
at file:///home/vscode/Source/test/packages/core/dist/index.js:1:458
at file:///home/vscode/Source/test/packages/core/dist/index.js:51:1680
at file:///home/vscode/Source/test/packages/core/dist/index.js:1:458
at file:///home/vscode/Source/test/packages/core/dist/index.js:82:3623
index.ts
import express from "express";
import { daemon } from './lib/daemon';
const app = express();
const port = 3010;
app.get('/', (_req, res) => {
res.send('Hello, World!');
});
app.listen(port, () => {
console.log(`Server is running on http://localhost:${port}`);
});
./lib/daemon.ts
import { getStoreData, getItemData } from '../functions'
...
./functions/index.ts
import fs from 'fs';
import path from 'path';
...
// Some functions will use fs.statsync, path.dirname, path.basename
Upvote & Fund
We're using Polar.sh so you can upvote and help fund this issue.
We receive the funding once the issue is completed & confirmed by you.
Thank you in advance for helping prioritize & fund our backlog.
node v20.13.1
I am trying to run an express app after converting to ES modules, however I am running into a path error. Below is the package & TS configs. Also below is the node entrypoint & files.
I need some feedback if I am not properly bundling path & fs
package.json
tsconfig.json
tsup.config.ts
Performing
pnpm run build
andpnpm run start
returnsindex.ts
./lib/daemon.ts
./functions/index.ts
Upvote & Fund