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

__fili results in a reference error #9

Open
jabberwock31415 opened this issue Feb 27, 2023 · 0 comments
Open

__fili results in a reference error #9

jabberwock31415 opened this issue Feb 27, 2023 · 0 comments

Comments

@jabberwock31415
Copy link

Given this file, foo.js:

require('magic-globals');
console.log(`${__file}:${__line}: This works`);
console.log(`${__fili}: this doesn't`);

Running it results in the following error:

% node foo.js
foo:2: This works
/tmp/node_modules/magic-globals/magic-globals.js:62
    if ( typeof GLOBAL.__filid !== 'undefined' && GLOBAL.__filid )
    ^

ReferenceError: GLOBAL is not defined
    at get (/tmp/node_modules/magic-globals/magic-globals.js:62:5)
    at Object.<anonymous> (/tmp/foo.js:3:16)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47
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

No branches or pull requests

1 participant