Skip to content

Bug/Compatibility: "fractional" library causes ReferenceError in Parcel 2 #474

Description

@GiorgiKemo

Hi.

Description: While following the Recipe View implementation, I encountered a persistent Uncaught ReferenceError: Fraction is not defined. This occurred even with the correct named import: import { Fraction } from 'fractional';.

The Issue: It appears the fractional package has compatibility issues with the way Parcel 2 handles scoping and bundling. Even after clearing the .parcel-cache and dist folders, the error persisted.

The Solution: Switching to the fracty library resolved the issue immediately.

npm install fracty

import fracty from 'fracty';

Usage: ${ing.quantity ? fracty(ing.quantity).toString() : ''}

Suggested Action: Consider updating the course resources or the package.json in the starter files to use fracty instead of fractional to avoid this bundling error with Parcel 2.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions