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.
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.