Giter VIP home page Giter VIP logo

Comments (8)

SethFalco avatar SethFalco commented on July 28, 2024 1

Sorry for the noise!

Don't be afraid to spam me if anything else comes up! And thanks for trying the RC and querying/reporting problems. Feedback on the release notes is also welcome if you think the issue was the wording.

from svgo.

XhmikosR avatar XhmikosR commented on July 28, 2024

For example:

Could not resolve import "svgo/dist/svgo.browser.js" in C:\Users\xmr\Desktop\svgomg\src\js\svgo-worker\index.js using exports defined in C:\Users\xmr\Desktop\svgomg\node_modules\svgo\package.json.
[08:01:06] Finished 'bound js' after 301 ms
[08:01:06] Finished 'bound js' after 465 ms
Could not resolve import "svgo/dist/svgo.browser.js" in C:\Users\xmr\Desktop\svgomg\src\js\svgo-worker\index.js using exports defined in C:\Users\xmr\Desktop\svgomg\node_modules\svgo\package.json.
'svgo/dist/svgo.browser.js' is imported by src/js/svgo-worker/index.js, but could not be resolved – treating it as an external dependency
No name was provided for external module 'svgo/dist/svgo.browser.js' in output.globals – guessing 'svgo_browser_js'

I can change the imports but this means that the changes in v3.3.0 are indeed breaking. :/

from svgo.

XhmikosR avatar XhmikosR commented on July 28, 2024

@SethFalco I just tried 4.0.0-rc here: jakearchibald/svgomg@b2cdb05

And it seems it doesn't work:

C:\Users\xmr\Desktop\svgomg>npm i [email protected] -D
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies

added 982 packages, and audited 1032 packages in 33s

163 packages are looking for funding
  run `npm fund` for details

17 vulnerabilities (1 low, 5 moderate, 10 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

C:\Users\xmr\Desktop\svgomg>npm run dev

> [email protected] dev
> gulp dev

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in C:\Users\xmr\Desktop\svgomg\node_modules\svgo\package.json
    at exportsNotFound (node:internal/modules/esm/resolve:303:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:650:9)
    at resolveExports (node:internal/modules/cjs/loader:591:36)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (C:\Users\xmr\Desktop\svgomg\gulpfile.js:5:35)
    at Module._compile (node:internal/modules/cjs/loader:1376:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Did I miss something or something else is broken?

Thanks!

from svgo.

SethFalco avatar SethFalco commented on July 28, 2024

We don't export out package.json!

SVGOMG only used it for the version I believe, so you can do, which is the reason I added it:

const { VERSION } = require('svgo');

PS: A while back I opened a PR to update SVGO there too, but closed it later. In case it's helpful to you, these were the changes I proposed:

from svgo.

XhmikosR avatar XhmikosR commented on July 28, 2024

Damn it, I misread the migration notes :)

So, this works jakearchibald/svgomg@2c5835c

Sorry for the noise!

from svgo.

XhmikosR avatar XhmikosR commented on July 28, 2024

I don't follow the repos I have push rights so unless I'm CC'ed I won't see any issue :)

I'm keeping the xmr-dev branch for now since I have other PRs pending, but I left them as is after reading the new plans.

from svgo.

XhmikosR avatar XhmikosR commented on July 28, 2024

One thing I notice is the lack of extension in the browser export. Not a huge deal, but I prefer always adding an extension (plus xo errors by default for such cases).

Your call though :)

from svgo.

SethFalco avatar SethFalco commented on July 28, 2024

(plus xo errors by default for such cases)

Sorry, could you clarify what this means?

from svgo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.