Giter VIP home page Giter VIP logo

Comments (2)

aeworxet avatar aeworxet commented on July 17, 2024

Shani Alaluf Shamah
Can you please clarify what value are you passing to $ref, because I have tried passing to $ref in YAML

  • array, YAML object, number, boolean, but all I get is
TypeError: ref.startsWith is not a function
  • with absence of value (NOT '') and null I get
TypeError: Cannot read properties of null (reading 'startsWith')
  • with an empty string '' the value is simply ignored (no exception thrown, execution successful)

  • with ./, /, https..., function, undefined Node.js gives various errors of failing to open or fetch file.

But no TypeError: Cannot read property 'startsWith' of undefined

So for now I cannot reproduce exactly your bug, to begin fixing it, on Node.js v16.17.0 and Node.js v18.9.0.

Maciej Urbańczyk solution

function isExternalReference(ref: string): boolean {
  return typeof ref === 'string' && !ref.startsWith('#');
}

works - it makes bundler ignore any value that is not a string, thus might fix exactly your issue indirectly, so it definitely should be merged.

After this change is merged, please comment if exactly your issue was fixed.

from bundler.

aeworxet avatar aeworxet commented on July 17, 2024

User did not provide feedback, assuming issue fixed, resolved and closed.

from bundler.

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.