I have problems with a web application uploaded to Netlify.
The site address is forkify-aj.netlify.app.
The site is using continuous deployment, connected to my GitHub repo.
Everything is working for me on locally in developing mode, and in final build run locally with live-server.
I tried it both with asset optimization enabled and disabled on Netlify.
The error is that: Fraction is not declared, which is a module imported through common js library.
I compared the file on Netlify using chrome dev tools, to my local build compressed files, the function is declared the same way in both.
This also tells me that there was no problem getting the module from common js, which was confirmed by NOT minifying files on Netlify.
I can also see from this that fractional is added in the file structure.
The error is thrown in a parent to where this is used, in a function that has nothing to do with fractions, which i don’t understand why.
This function is also never used in the child module that actually uses fraction.
If i remove fraction, the application run as intended, but obviously i would like to get this working instead.
I have done a lot of experimenting to the files, imports, spell check and more, made no difference.
I also tried to import fraction into the module where the error is thrown, this caused the error to be thrown in runtime-xxx.js instead.
With all changes i also re deploy without cache, to avoid issues from that.
this application was made following a course, that includes uploading to Netlify.
The difference i noticed with files are that the course videos use core-js 3.6.5, while i use 3.18.3, i assume this is not causing any problem.
There is also some difference to the Netlify UI, where i get some additional setting when creating a site.
I can specify a base directory, which i left blank because the entry file for my build command is in the main repo directory, and only contains this application.
I also have the final files which the course uploaded to Netlify, i tried uploading the same files to my account, same problem: Fraction not declared.
This leads me to belive that the problem is with Netlify and not my files.
Any help with getting this working correctly would be appreciated, even though this application is of no significance, i would still like to know for future use what is going wrong.
Deploy log
10:14:00 AM: Build ready to start
10:14:02 AM: build-image version: 3bcb38c35508b42e9121d4badfe6d8c66fd7a3f0
10:14:02 AM: build-image tag: v4.3.2
10:14:02 AM: buildbot version: 5f1a3c6e77d89b95b77370734ae1aecf3a51e9c1
10:14:02 AM: Building without cache
10:14:02 AM: Starting to prepare the repo for build
10:14:05 AM: No cached dependencies found. Cloning fresh repo
10:14:05 AM: git clone https://github.com/amgj-dev/Forkify
10:14:06 AM: Preparing Git Reference refs/heads/master
10:14:07 AM: Parsing package.json dependencies
10:14:07 AM: Starting build script
10:14:08 AM: Installing dependencies
10:14:08 AM: Python version set to 2.7
10:14:08 AM: Downloading and installing node v16.12.0…
10:14:09 AM: Downloading https://nodejs.org/dist/v16.12.0/node-v16.12.0-linux-x64.tar.xz…
10:14:09 AM: Computing checksum with sha256sum
10:14:09 AM: Checksums matched!
10:14:12 AM: Now using node v16.12.0 (npm v8.1.0)
10:14:12 AM: Started restoring cached build plugins
10:14:12 AM: Finished restoring cached build plugins
10:14:12 AM: Attempting ruby version 2.7.2, read from environment
10:14:14 AM: Using ruby version 2.7.2
10:14:14 AM: Using PHP version 8.0
10:14:14 AM: Started restoring cached node modules
10:14:14 AM: Finished restoring cached node modules
10:14:15 AM: Installing NPM modules using NPM version 8.1.0
10:14:16 AM: npm WARN old lockfile
10:14:16 AM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
10:14:16 AM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
10:14:16 AM: npm WARN old lockfile
10:14:16 AM: npm WARN old lockfile This is a one-time fix-up, please be patient…
10:14:16 AM: npm WARN old lockfile
10:14:29 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
10:14:30 AM: npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
10:14:31 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
10:14:31 AM: npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
10:14:31 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
10:14:40 AM: added 678 packages, and audited 679 packages in 25s
10:14:40 AM: 143 packages are looking for funding
10:14:40 AM: run npm fund
for details
10:14:40 AM: found 0 vulnerabilities
10:14:40 AM: NPM modules installed
10:14:41 AM: Started restoring cached go cache
10:14:41 AM: Finished restoring cached go cache
10:14:41 AM: go version go1.16.5 linux/amd64
10:14:41 AM: go version go1.16.5 linux/amd64
10:14:41 AM: Installing missing commands
10:14:41 AM: Verify run directory
10:14:42 AM:
10:14:42 AM: ────────────────────────────────────────────────────────────────
10:14:42 AM: Netlify Build
10:14:42 AM: ────────────────────────────────────────────────────────────────
10:14:42 AM:
10:14:42 AM: ❯ Version
10:14:42 AM: @netlify/build 18.17.7
10:14:42 AM:
10:14:42 AM: ❯ Flags
10:14:42 AM: baseRelDir: true
10:14:42 AM: buildId: 6177b8c8eba7b5a197aac53e
10:14:42 AM: deployId: 6177b8c8eba7b5a197aac540
10:14:42 AM:
10:14:42 AM: ❯ Current directory
10:14:42 AM: /opt/build/repo
10:14:42 AM:
10:14:42 AM: ❯ Config file
10:14:42 AM: No config file was defined: using default values.
10:14:42 AM:
10:14:42 AM: ❯ Context
10:14:42 AM: production
10:14:42 AM:
10:14:42 AM: ────────────────────────────────────────────────────────────────
10:14:42 AM: 1. Build command from Netlify app
10:14:42 AM: ────────────────────────────────────────────────────────────────
10:14:42 AM:
10:14:42 AM: $ npm run build
10:14:43 AM: > forkify@1.0.0 build
10:14:43 AM: > parcel build index.html --dist-dir ./dist
10:14:43 AM: Building…
10:14:46 AM: Bundling…
10:14:47 AM: Packaging & Optimizing…
10:14:53 AM: Built in 9.53s
10:14:53 AM: dist/index.html 3.89 KB 2.69s
10:14:53 AM: dist/favicon.76dd299c.png 8.25 KB 5.39s
10:14:53 AM: dist/logo.8a7af738.png 57.71 KB 2.29s
10:14:53 AM: dist/icons.9801e6f1.svg 8.81 KB 5.88s
10:14:53 AM: dist/index.07177311.css 9.98 KB 3.18s
10:14:53 AM: dist/index.f5f7a34c.js 135.11 KB 5.50s
10:14:53 AM: dist/icons.9801e6f1.svg 8.81 KB 3.18s
10:14:53 AM:
10:14:53 AM: (build.command completed in 10.3s)
10:14:53 AM:
10:14:53 AM: ────────────────────────────────────────────────────────────────
10:14:53 AM: 2. Deploy site
10:14:53 AM: ────────────────────────────────────────────────────────────────
10:14:53 AM:
10:14:53 AM: Starting to deploy site from ‘dist’
10:14:53 AM: Creating deploy tree
10:14:53 AM: Creating deploy upload records
10:14:53 AM: 1 new files to upload
10:14:53 AM: 0 new functions to upload
10:14:53 AM: Site deploy was successfully initiated
10:14:53 AM:
10:14:53 AM: (Deploy site completed in 315ms)
10:14:53 AM:
10:14:53 AM: ────────────────────────────────────────────────────────────────
10:14:53 AM: Netlify Build Complete
10:14:53 AM: ────────────────────────────────────────────────────────────────
10:14:53 AM:
10:14:53 AM: (Netlify Build completed in 10.7s)
10:14:53 AM: Starting post processing
10:14:53 AM: Skipping HTML post processing
10:14:53 AM: Post processing - header rules
10:14:53 AM: Post processing - redirect rules
10:14:53 AM: Post processing done
10:14:53 AM: Site is live
10:14:53 AM: Caching artifacts
10:14:53 AM: Started saving node modules
10:14:53 AM: Finished saving node modules
10:14:53 AM: Started saving build plugins
10:14:53 AM: Finished saving build plugins
10:14:53 AM: Started saving pip cache
10:14:54 AM: Finished saving pip cache
10:14:54 AM: Started saving emacs cask dependencies
10:14:54 AM: Finished saving emacs cask dependencies
10:14:54 AM: Started saving maven dependencies
10:14:54 AM: Finished saving maven dependencies
10:14:54 AM: Started saving boot dependencies
10:14:54 AM: Finished saving boot dependencies
10:14:54 AM: Started saving rust rustup cache
10:14:54 AM: Finished saving rust rustup cache
10:14:54 AM: Started saving go dependencies
10:14:54 AM: Finished saving go dependencies
10:14:56 AM: Build script success
10:15:28 AM: Finished processing build request in 1m25.709132247s