Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'map' of undefined #5

Open
swiesend opened this issue May 16, 2021 · 2 comments
Open

TypeError: Cannot read property 'map' of undefined #5

swiesend opened this issue May 16, 2021 · 2 comments

Comments

@swiesend
Copy link

swiesend commented May 16, 2021

I installed as instructed and tried to start with:
./node_modules/imba/bin/imba -w src/express.imba and my global imba imba -w src/express.imba

$ node --version
v16.1.0
$ npm --version
7.13.0
$ npm list imba
ssr-app-imba@ ~/develop/imba/ssr-app-imba
└── [email protected]
$ npm -g list imba
/home/sebastian/.npm/lib
└── [email protected]
× failed with 2 errors [
  {
    detail: TypeError: Cannot read property 'map' of undefined
        at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:13400:28
        at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
        at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30),
    location: {
      column: 27,
      file: 'node_modules/imba/bin/imba.imba.js',
      length: 0,
      line: 13400,
      lineText: '        errors: res.errors.map(function(_0) {\n' +
        '    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:13400:28\n' +
        '    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)\n' +
        '    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)',
      namespace: 'file'
    },
    notes: [ [Object], [Object] ],
    text: "[imba] Cannot read property 'map' of undefined"
  },
  {
    detail: TypeError: Cannot read property 'map' of undefined
        at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:13400:28
        at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
        at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30),
    location: {
      column: 27,
      file: 'node_modules/imba/bin/imba.imba.js',
      length: 0,
      line: 13400,
      lineText: '        errors: res.errors.map(function(_0) {\n' +
        '    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:13400:28\n' +
        '    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)\n' +
        '    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)',
      namespace: 'file'
    },
    notes: [ [Object], [Object] ],
    text: "[imba] Cannot read property 'map' of undefined"
  }
]
Copy link
Member

somebee commented Jun 15, 2021

I think this should be fixed in the latest alphas.

@swiesend
Copy link
Author

swiesend commented Jun 19, 2021

I have tried, but unfortunately not. Am I doing something wrong? Maybe using some global package/node/npm instead of the local ones?

$ node --version
v16.3.0
$ npm --version
7.18.1
$ npm list imba
ssr-app-imba@ /home/sebastian/develop/imba/ssr-app-imba
└── imba@2.0.0-alpha.145

$ sudo -H npm list imba
ssr-app-imba@ /home/sebastian/develop/imba/ssr-app-imba
└── imba@2.0.0-alpha.145

$ sudo npm list imba
ssr-app-imba@ /home/sebastian/develop/imba/ssr-app-imba
└── imba@2.0.0-alpha.145

$ npm -g list imba
/home/sebastian/.npm/lib
└── imba@2.0.0-alpha.145

$ sudo -H npm -g list imba
/usr/lib
└── imba@2.0.0-alpha.145

$ sudo npm -g list imba
/usr/lib
└── imba@2.0.0-alpha.145
$ npm start

> start
> imba src/http.imba

 > node_modules/imba/bin/imba.imba.js:16186:27: error: [imba] Cannot read property 'map' of undefined
    16186          errors: res.errors.map(function(_0) {
                                      ^
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28
    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)

   node_modules/imba/bin/imba.imba.js:16170:15: note: This error came from the "onLoad" callback registered here
    16170      return esb.onLoad({filter: /\.imba1?$/}, async function({path, namespace}) {
                          ~~~~~~
    at Bundle.plugin (/home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16170:16)
    at handlePlugins (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:686:7)
    at Object.buildOrServe (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:903:44)
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1444:17
    at new Promise (<anonymous>)
    at Object.build (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1443:14)
    at Object.build (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1334:51)
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16219:41
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

   node_modules/imba/src/imba/imba.imba:12:14: note: The plugin "imba" was triggered by this import
       12 │ export * from './dom/styles';
          ╵               ~~~~~~~~~~~~~~

 > node_modules/imba/bin/imba.imba.js:16186:27: error: [imba] Cannot read property 'map' of undefined
    16186          errors: res.errors.map(function(_0) {
                                      ^
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28
    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)

   node_modules/imba/bin/imba.imba.js:16170:15: note: This error came from the "onLoad" callback registered here
    16170      return esb.onLoad({filter: /\.imba1?$/}, async function({path, namespace}) {
                          ~~~~~~
    at Bundle.plugin (/home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16170:16)
    at handlePlugins (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:686:7)
    at Object.buildOrServe (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:903:44)
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1444:17
    at new Promise (<anonymous>)
    at Object.build (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1443:14)
    at Object.build (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1334:51)
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16219:41
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

   node_modules/imba/src/imba/process.imba:11:16: note: The plugin "imba" was triggered by this import
       11 │ import log from '../utils/logger'/*$path$*/;
          ╵                 ~~~~~~~~~~~~~~~~~

× failed with 2 errors [
  {
    detail: TypeError: Cannot read property 'map' of undefined
        at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28
        at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
        at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30),
    location: {
      column: 27,
      file: 'node_modules/imba/bin/imba.imba.js',
      length: 0,
      line: 16186,
      lineText: '        errors: res.errors.map(function(_0) {\n' +
        '    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28\n' +
        '    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)\n' +
        '    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)',
      namespace: 'file'
    },
    notes: [ [Object], [Object] ],
    text: "[imba] Cannot read property 'map' of undefined"
  },
  {
    detail: TypeError: Cannot read property 'map' of undefined
        at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28
        at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
        at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30),
    location: {
      column: 27,
      file: 'node_modules/imba/bin/imba.imba.js',
      length: 0,
      line: 16186,
      lineText: '        errors: res.errors.map(function(_0) {\n' +
        '    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28\n' +
        '    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)\n' +
        '    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)',
      namespace: 'file'
    },
    notes: [ [Object], [Object] ],
    text: "[imba] Cannot read property 'map' of undefined"
  }
]
 > node_modules/imba/bin/imba.imba.js:16186:27: error: [imba] Cannot read property 'map' of undefined
    16186          errors: res.errors.map(function(_0) {
                                      ^
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16186:28
    at async callback (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:772:28)
    at async handleRequest (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:603:30)

   node_modules/imba/bin/imba.imba.js:16170:15: note: This error came from the "onLoad" callback registered here
    16170      return esb.onLoad({filter: /\.imba1?$/}, async function({path, namespace}) {
                          ~~~~~~
    at Bundle.plugin (/home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16170:16)
    at handlePlugins (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:686:7)
    at Object.buildOrServe (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:903:44)
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1444:17
    at new Promise (<anonymous>)
    at Object.build (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1443:14)
    at Object.build (/home/sebastian/develop/imba/ssr-app-imba/node_modules/esbuild/lib/main.js:1334:51)
    at /home/sebastian/develop/imba/ssr-app-imba/node_modules/imba/bin/imba.imba.js:16219:41
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

   node_modules/imba/src/imba/imba.imba:12:14: note: The plugin "imba" was triggered by this import
       12 │ export * from './dom/styles';
          ╵               ~~~~~~~~~~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants