WebMemex / webmemex-extension

📇 Your digital memory extension, as a browser extension
https://webmemex.org
Other
208 stars 45 forks source link

Object.values appears to not be transpiled #46

Closed RohanMishra97 closed 7 years ago

RohanMishra97 commented 7 years ago

Hello everyone, After having used the make command on the cloned repo, I loaded the extension on Chromium (Version 53.0.2785).

However, I can't find the visited pages or other elements of the Memory Overview. The dev-console shows the following error

Uncaught TypeError: Object.values is not a function

issue1

Thanks for the help! :)

PS- After a little research, I guess there is some problem with EC6 -EC5 conversion.

aquibm commented 7 years ago

Hi,

Could you please try issuing the commands npm install followed by npm run build in the root directory of the project?

Cheers, Aquib.

RohanMishra97 commented 7 years ago

After following the instructions, I got this output

[01:50:14] Requiring external module babel-register [01:50:27] Using gulpfile ~/webmemex-extension/gulpfile.babel.js

I have tried using npm install --save-dev babel-register , but to no effect. This issue seems to be of a similar case.

Treora commented 7 years ago

Thanks for reporting; I do not understand why the ES6->ES5 conversion would not convert the Object.values function.. It should create something like var _values = require('babel-runtime/core-js/object/values'); in the built code (extension/overview/overview.js), and call that (or its derivative _values2) instead of Object.values. You could grep the file to see if it's there.

For comparison, the output from running make (or npm run build) looks like this for me:

$ make
npm run build

> webmemex-extension@0.1.0 build /home/gerben/projects/webmemex/extension/webmemex-extension
> gulp build

[00:21:21] Requiring external module babel-register
[00:21:22] Using gulpfile ~/projects/webmemex/extension/webmemex-extension/gulpfile.babel.js
[00:21:22] Starting 'build'...
[00:21:22] Finished 'build' after 26 ms
Bundled options.js in 10.406s.
Bundled background.js in 11.009s.
Bundled content_script.js in 11.509s.
Bundled overview.js in 11.526s.

The babel-register is also there, probably normal. Do you get the rest of this output as well?

Let know if the problem persists and we'll look further tomorrow.

reficul31 commented 7 years ago

What worked for me was combining the epics in the overview/epics.js by

export const rootEpic = combineEpics(refreshSearchResultsUponQueryChange,
    refreshSearchResultsUponLogChange)

then in overview/store

const rootEpic = overview.epics.rootEpic

I know this is a very hacky way but I wanted to get started quickly and this helped me do just that. Although I will keep searching for the right solution for the problem.

RohanMishra97 commented 7 years ago

Thanks a lot!

Treora commented 7 years ago

Ok, so if it is only Object.values that is not transpiled, perhaps some incompatible changes happened in the babel presets (we use stage-1 to support features from the upcoming standard), or the preset was not doing what I understood it did.

By the way, Chromium≥54 does support Object.values, which may be why I never got the error myself.