sarsamurmu / reboost

A super fast dev server for rapid web development
MIT License
61 stars 3 forks source link

Error while importing awaitable-timers #59

Open GHNewbiee opened 3 years ago

GHNewbiee commented 3 years ago

After typing npm i awaitable-timers and

import {
  setTimeout,
  setImmediate,
  setInterval
} from 'awaitable-timers';

I get the following errors:

reboost-awaitable-timers-error-1 reboost-awaitable-timers-error-2

where

awaitable-timers/index.js

'use strict';

// Use the built-in implementations if they are present.
try {
  const {
    setTimeout,
    setImmediate,
    setInterval,
  } = require('timers/promises');

  module.exports = {
    setTimeout,
    setImmediate,
    setInterval,
  };

  return;
} catch {
  // Do nothing with the error.
}
...

Any suggestion? Tia

GHNewbiee commented 3 years ago

And

reboost.js

const {
  start,
  builtInPlugins: {
    esbuildPlugin
  }
} = require('reboost');

start({
  cacheOnMemory: true,
  contentServer: [
    {
      ...
    }
  ],
  entries: [
    ...
  ],
  hotReload: true,
  plugins: [
    esbuildPlugin({})
  ]
});
sarsamurmu commented 3 years ago

Temporary fix for now

GHNewbiee commented 3 years ago

Now, I get:

TypeError: Cannot read properties of null (reading 'type')
      at findVisiblePathsInPattern (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:646:23)
      at registerBindingFromPattern (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:702:5)
      at CatchClause (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:823:9)
      at Scope.crawl (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:907:17)
      at Scope.init (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:885:14)
      at NodePath.init (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/nodepath.js:93:24)
      at Scope.crawl (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:966:39)
      at Scope.init (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/scope.js:885:14)
      at NodePath.init (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/nodepath.js:93:24)
      at Traverser.visitPath (/home/.../SharedFolder/Frameworks/reboost-lit-test/node_modules/estree-toolkit/dist/traverse.js:25:18)

BUT I am not sure 100% that I do everything correct from my side. Please test the functions when you have some free time. Tia

GHNewbiee commented 3 years ago

And those errors and warnings:

Loading module from “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Fawaitable-timers%2Findex.js” was blocked because of a disallowed MIME type (“text/plain”).
localhost:8000
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Fawaitable-timers%2Findex.js. (Reason: CORS request did not succeed).

Module source URI is not allowed in this document: “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Fawaitable-timers%2Findex.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Freactive-element.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Flit-html%2Flit-html.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Flit-element%2Flit-element.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fcustom-element.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fproperty.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fquery.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fquery-all.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fquery-async.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fquery-assigned-nodes.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fevent-options.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2F%40lit%2Freactive-element%2Fdecorators%2Fstate.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Flit-html%2Fdirectives%2Fclass-map.js”. localhost:8000:8:1
Loading failed for the module with source “http://192.168.1.53:7456/transformed?q=%2Fhome%2F...%2FSharedFolder%2FFrameworks%2Freboost-lit-test%2Fnode_modules%2Flit-html%2Fdirectives%2Fstyle-map.js”. localhost:8000:8:1
sarsamurmu commented 3 years ago

I don't think I can do anything about it now. Try to implement the awaitable-timers functions by yourself for now.