BlinkTagInc / gtfs-to-html

Build human readable transit timetables as HTML or PDF from GTFS.
https://gtfstohtml.com
MIT License
181 stars 57 forks source link

"Error: fetch is not defined" #169

Closed pedrobusway closed 4 days ago

pedrobusway commented 4 weeks ago

Hi!

I'm trying to use this plugin using Docker and i get this error:

`PS C:\Users\Pedro Silva\gtfs-to-html-master> docker build -t gtfs-to-html . [+] Building 80.4s (14/14) FINISHED docker:desktop-linux => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 244B 0.0s => resolve image config for docker-image://docker.io/docker/dockerfile:1 0.9s => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:fe40cf4e92cd0c467be2cfc30657a680ae2398318afd50b0c80585784c604f28 0.0s => [internal] load metadata for docker.io/library/node:16 0.8s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/7] FROM docker.io/library/node:16@sha256:f77a1aef2da8d83e45ec990f45df50f1a286c5fe8bbfb8c6e4246c6389705c0b 0.0s => [internal] load build context 0.0s => => transferring context: 1.66kB 0.0s => CACHED [2/7] RUN apt update 0.0s => CACHED [3/7] RUN apt install -y chromium 0.0s => CACHED [4/7] RUN cd ~/ 0.0s => [5/7] COPY config.json ./ 0.0s => [6/7] RUN npm -g config set user root 0.7s => [7/7] RUN npm install -g gtfs-to-html 76.2s => exporting to image 1.7s => => exporting layers 1.7s => => writing image sha256:260334916f1b3542d9fa977903f5e0ecbdeb6390166ff3faf621eaa67a089f0e 0.0s => => naming to docker.io/library/gtfs-to-html 0.0s

View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/ay6caj2mfyzcccfiqinn72vhg PS C:\Users\Pedro Silva\gtfs-to-html-master> docker run gtfs-to-html

Starting GTFS import for 1 file using SQLite database at :memory: Downloading GTFS from https://busway-cira.pt/gtfs/2024.07.24.zip Error: fetch is not defined ReferenceError: fetch is not defined

PS C:\Users\Pedro Silva\gtfs-to-html-master>`

What can be?

My config file is this one: config.json

Thanks!

brendannee commented 4 weeks ago

Thanks for reporting this.

The dockerfile needed to have the node.js version updated to v20 - Check out the latest released of GTFS-to-HTML https://github.com/BlinkTagInc/gtfs-to-html/releases/tag/2.7.2 and it should work.