Comments (10)
Hi @loynoir thanks for reporting! As far as I am aware, all versions of Node.js have that function, and also the error looks weird and there is no stack trace. Can you help by providing the following information?
- Version of Node.js you are running this module on
- Version of this module you are running
Thank you!
from nodejs-depd.
"depd": "^2.0.0"
$ node --frozen-intrinsics
Welcome to Node.js v16.18.0.
> require('depd')('http-errors')('non-error status code; use only 4xx or 5xx status codes')
Uncaught:
TypeError <Object <Object <[Object: null prototype] {}>>>: callSite.getFileName is not a function
at callSiteLocation (/path/to/node_modules/.pnpm/[email protected]/node_modules/depd/index.js:268:23)
at depd (/path/to/node_modules/.pnpm/[email protected]/node_modules/depd/index.js:109:14)
$ node --frozen-intrinsics
Welcome to Node.js v18.12.0.
> require('depd')('http-errors')('non-error status code; use only 4xx or 5xx status codes')
Uncaught:
TypeError <Object <Object <[Object: null prototype] {}>>>: callSite.getFileName is not a function
at callSiteLocation (/path/to/node_modules/.pnpm/[email protected]/node_modules/depd/index.js:268:23)
at depd (/path/to/node_modules/.pnpm/[email protected]/node_modules/depd/index.js:109:14)
from nodejs-depd.
Oh, I see now, it's something to do with --frozen-intrinsics
(https://nodejs.org/dist/latest-v18.x/docs/api/cli.html#--frozen-intrinsics). It seems that is experimental and your output should be having an experimental warning. Weird that you're not seeing that warning. But I can look into what it would take to support that environment, though since it's experimental not sure on what I can promise around that, as experimental features of Node.js change often which makes them hard to support correctly.
from nodejs-depd.
Ah I delete that warning, I guess easier to read.
$ pnpm node --frozen-intrinsics
(node:6252) ExperimentalWarning: The --frozen-intrinsics flag is experimental
(Use `node --trace-warnings ...` to show where the warning was created)
Welcome to Node.js v18.12.0.
Type ".help" for more information.
> require('depd')('http-errors')('non-error status code; use only 4xx or 5xx status codes')
Uncaught:
TypeError <Object <Object <[Object: null prototype] {}>>>: callSite.getFileName is not a function
at callSiteLocation (/path/to/node_modules/.pnpm/[email protected]/node_modules/depd/index.js:268:23)
at depd (/path/to/node_modules/.pnpm/[email protected]/node_modules/depd/index.js:109:14)
from nodejs-depd.
Ah. But yea, as the Node.js docs state:
Code may break under this flag.
I'll take a look into what it would take to support that and see how the flag varies across the Node.js versions released so far to get a hint at future direction of the experimental feature too. For now, I would suggest not using that feature if you want to use this module.
from nodejs-depd.
from nodejs-depd.
I'm not sure what that link means.
from nodejs-depd.
There is nodejs contributor suggestion, maybe, to use that flag to protect prototype pollution instead of crashed Object.freeze(NODE_GLOBAL_AND_ITS_PROTOTYPE)
.
from nodejs-depd.
Ah. But yea, like I pointed out, the Node.js documentation for --frozen-intrinsics
(https://nodejs.org/dist/latest-v18.x/docs/api/cli.html#--frozen-intrinsics) specifically states the following:
Code may break under this flag.
And it looks like indeed, this code does break under that flag. Node.js seems well aware you're going to run into issues with that experimental feature. Like I said, I will look into what it would take to work with that flag, if it is even possible. But it is experimental and as Node.js states:
Stability: 1 - Experimental. The feature is not subject to semantic versioning rules. Non-backward compatible changes or removal may occur in any future release. Use of the feature is not recommended in production environments.
I will try my best to support it, but supporting experimental features are hard by their nature of random changes without concern for breaking things.
from nodejs-depd.
Ah, have a look where is the first place goes wrong when using that flag.
Line 386 in 7ad9a48
So, this seems related to #16
with --frozen-intrinsics
> Error.prepareStackTrace = ()=>{}
[Function (anonymous)] Function <Function <[Object: null prototype] {}>>
> Error.prepareStackTrace
undefined
from nodejs-depd.
Related Issues (20)
- Drop eval usage HOT 21
- line info is not help HOT 8
- Cannot redefine property: callSiteToString HOT 2
- Call-site calculation does not fail gracefully when Stack information is unavailable HOT 14
- Call site calculation fails when importing an esm'ed package that imports sequelize internally HOT 14
- Respect --no-deprecation and process.noDeprecation HOT 17
- TypeError: eval is not a function HOT 8
- Why is this library overwriting Error type? HOT 5
- Turkish Language Problem HOT 2
- Incopatibile with --enable-source-maps node 12 option HOT 7
- (!) Use of eval is strongly discouraged, rollup HOT 1
- compatibility with Node.js' source-map implementation HOT 12
- please rewrite nodejs-depd with modern syntax HOT 1
- Compatibility with --disallow-code-generation-from-strings HOT 9
- Use of eval() is strongly discouraged, as it poses security risks HOT 9
- Calling `process.cwd()` from index.js can be problematic HOT 4
- callSite.getFileName() is not Function HOT 5
- NodeJS 20.11.0 fails when building snapshot.
- compatibility with node --frozen-intrinsics security option HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodejs-depd.