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

href-content 2.0.3 is breaking from 2.0.2 #129

Open
azelfayyad-bri opened this issue Mar 14, 2024 · 3 comments
Open

href-content 2.0.3 is breaking from 2.0.2 #129

azelfayyad-bri opened this issue Mar 14, 2024 · 3 comments

Comments

@azelfayyad-bri
Copy link

I am using this package indirectly for a nodejs project, via html-pdf-node package, just yesterday when I reinstalled the dependencies on a development environment I got this error:

/xxxxxx/node_modules/remote-content/node_modules/axios/index.js:1
(function (exports, require, module, __filename, __dirname) { import axios from './lib/axios.js';
                                                                     ^^^^^
SyntaxError: Unexpected identifier
    at new Script (vm.js:84:7)
    at createScript (vm.js:264:10)
    at Object.runInThisContext (vm.js:312:10)
    at Module._compile (internal/modules/cjs/loader.js:694:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at Module.Hook._require.Module.require (/xxxxxx/node_modules/require-in-the-middle/index.js:188:39)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/xxxxxx/node_modules/remote-content/index.js:1:77)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at Module.Hook._require.Module.require (/xxxxxx/node_modules/require-in-the-middle/index.js:188:39)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/xxxxxx/node_modules/href-content/index.js:3:26)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at Module.Hook._require.Module.require (/xxxxxx/node_modules/require-in-the-middle/index.js:188:39)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/xxxxxx/node_modules/extract-css/index.js:5:24)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at Module.Hook._require.Module.require (/xxxxxx/node_modules/require-in-the-middle/index.js:188:39)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/xxxxxx/node_modules/inline-css/lib/inlineContent.js:1:82)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at Module.Hook._require.Module.require (/xxxxxx/node_modules/require-in-the-middle/index.js:188:39)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/xxxxxx/node_modules/inline-css/index.js:1:85)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
    at Module.Hook._require.Module.require (/xxxxxx/node_modules/require-in-the-middle/index.js:188:39)
    at require (internal/modules/cjs/helpers.js:20:18)

I compared my production build with the development build and noticed that href-content changing from version 2.0.2 to 2.0.3 breaks my project, I think because some of its dependency upgrades axios version to a breaking version and causes the error. Related dependency tree: [email protected] > [email protected] > [email protected] > [email protected]

My environment:
npm: 6.5.0
node: 11.9.0

@jonkemp
Copy link
Owner

jonkemp commented Mar 19, 2024

node versions less than v16 are not supported so I can't verify it works on a version that old. I would suggest updating your node version and try again. Let me know how it goes.

@RShah512
Copy link

RShah512 commented Jun 4, 2024

@azelfayyad-bri +1
Did you find a solution other than upgrading the node version?

@azelfayyad-bri
Copy link
Author

@azelfayyad-bri +1 Did you find a solution other than upgrading the node version?

I added href-content 2.0.2 as a dependency of my app even though it wasn't being used directly.

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

3 participants