zachleat / speedlify

Benchmark the web performance and accessibility of sites over time.
https://www.speedlify.dev/
MIT License
924 stars 167 forks source link

Cannot find module './results-last-runs.json' #28

Closed OIITCONZ closed 4 years ago

OIITCONZ commented 4 years ago

Following the instructions for the local install - I :

Looking at the folder, there is no file named 'results-last-runs.json'

This is always going to throw an error on the first run if the file is missing and doesn't seem to create it on first run

itsupport@oit-lt02 MINGW64 ~/Dropbox/Dev/2-speedlify (live) $ npm run test-pages

speedlify@1.0.0 test-pages C:\Users\itsupport\Dropbox\Dev\2-speedlify node run-tests

There are no known last run timestamps Skipping test-runners (you told me to in your site config)

itsupport@oit-lt02 MINGW64 ~/Dropbox/Dev/2-speedlify (live) $ npm run start

speedlify@1.0.0 start C:\Users\itsupport\Dropbox\Dev\2-speedlify npx @11ty/eleventy --quiet --serve

Cannot find module './results-last-runs.json' Require stack:

  • C:\Users\itsupport\Dropbox\Dev\2-speedlify_data\lastruns.js
  • C:\Users\itsupport\Dropbox\Dev\2-speedlify\node_modules\@11ty\eleventy\src\TemplateData.js
  • C:\Users\itsupport\Dropbox\Dev\2-speedlify\node_modules\@11ty\eleventy\src\Eleventy.js
  • C:\Users\itsupport\Dropbox\Dev\2-speedlify\node_modules\@11ty\eleventy\cmd.js

Error was thrown: Error: Cannot find module './results-last-runs.json' Require stack:

OIITCONZ commented 4 years ago

Checked the file config I left behind / altered. It fails to run if is local site. Removed that line. Possibly need some docs on the config files.

Also your instructions are for one of the test files (test-runners) which doesn't run local without changing it.

Possibly instructions should include: Delete all site files except test-runners.js

Comment out line 5. Change example.com to sites you want to test. Save.

Then run the instructions given.

My new test-runners.js is now: `module.exports = { description: "Front-end Testing Tools", // skip if localhost // skip if this is a new fork of the speedlify (not Zach’s) //skip: !process.env.CONTEXT || process.env.SITE_NAME !== "speedlify", options: { frequency: 60 * 11 + 30, // 11h, 30m // Use "run" if the sites don’t share assets on the same origin // and we can reset chrome with each run instead of // each site in every run (it’s faster) // Use "site" if sites are all on the same origin and share

assets. freshChrome: "run", }, urls: [ "https://example1.com/", "https://example2.com/", "https://example3.com/test.html"

]

};`

zachleat commented 4 years ago

Sorry about this! I made some changes, can you retest?

zachleat commented 4 years ago

This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.

If the response works to solve your problem—great! But if you’re still having problems, do not let the issue’s closing deter you if you have additional questions! Post another comment and I will reopen the issue. Thanks!