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

epub import do nothing #162

Closed
Crash-- opened this issue Jul 2, 2018 · 20 comments
Closed

epub import do nothing #162

Crash-- opened this issue Jul 2, 2018 · 20 comments

Comments

@Crash--
Copy link

Crash-- commented Jul 2, 2018

Currently based on master, when I try to upload an epub file (from here : http://fr.feedbooks.com/publicdomain), nothing happens.

Step to reproduce :

  • npm run start:dev
  • click on add en epub
  • select your epub
  • click on open

Expected :

  • To see my epub file in my library

Details:

  • Nothing in the JS Console
  • In the network tab, I can see the cover of my book (with this kind of url : store://f6071130-fc49-4b4a-817c-bb3cf9a1394e/cover.png)
  • OS X : 10.13.5
@danielweck
Copy link
Member

danielweck commented Jul 2, 2018

Thank you for the bug report.

Any chance you could please try this branch?
https://github.com/readium/readium-desktop/tree/feature/npm-update-packs
(with a clean package-lock.json from the branch, then rm -rf node_modules && (npm ci || npm install) && npm run __postinstall && npm run start && npm run start:dev to make sure everything is setup properly)
Many thanks!

@danielweck
Copy link
Member

I am also observing the same bug with the feature/npm-update-packs branch.
npm start and npm run start:dev
Node 8.11.3
NPM 6.1.0
MacOS
EPUBs from: https://github.com/edrlab/r2-testapp-js/tree/develop/misc/epubs

@danielweck
Copy link
Member

Note that the master branch is currently the same as the v1.0.0-alpha.2 release tag (so it should runs just fine, like the officially-distributed app installers):
https://github.com/readium/readium-desktop/commits/master
https://github.com/readium/readium-desktop/commits/v1.0.0-alpha.2

@danielweck
Copy link
Member

danielweck commented Jul 2, 2018

Just to be sure, I installed v1.0.0-alpha.2 from https://github.com/readium/readium-desktop/releases/tag/v1.0.0-alpha.2
Everything seems to work fine.

I am now trying the master branch (making sure to reset NPM dependencies rm -rf node_modules && (npm ci || npm install) && npm run __postinstall && npm run start && npm run start:dev)

@danielweck
Copy link
Member

Seems to work fine from the master branch (as per the above instructions)...trying develop now.

@danielweck
Copy link
Member

Works fine with the develop branch too. Now trying feature/npm-update-packs again (just to make sure the publication databases are synched, and the NPM node_modules is clean) ...

@danielweck
Copy link
Member

At my end: bug confirmed in feature/npm-update-packs, but not develop and master. @Crash-- (Quentin) Are you sure you are on a clean master? (please use rm -rf node_modules && (npm ci || npm install) && npm run __postinstall && npm run start && npm run start:dev to make sure)

@danielweck
Copy link
Member

danielweck commented Jul 2, 2018

On MacOS, I can see that the EPUB import actually succeeds, and that the database is somehow initialized correctly (npm run start:dev, therefore the JSON "dev" database implementation, which is different than npm run start production one):

/Users/{ME}/Library/Application Support/readium-desktop/publications/{UUID}/book.epub and {UUID}/cover.jpeg (which I can see in the webview inspector / debugger as store://{UUID}/cover.jpeg)

/Users/{ME}/Library/Application Support/readium-desktop/db-dev/publications/data.json

...but the store / library view does not seem to function properly.

@danielweck
Copy link
Member

I found the source of the problem in feature/npm-update-packs (react-dropzone regression bug), but this does not explain why you are experiencing this issue in master.

@nguyenhuutuananh
Copy link

I got some problem at yesterday like @Crash-- !
But today i try again with below commands then it's works!

rm -rf node_modules && (npm ci || npm install) && npm run __postinstall && npm run start && npm run start:dev

@Crash--
Copy link
Author

Crash-- commented Jul 12, 2018

If I start with a clean package.json from master I've this error :

 ERROR in ./src/renderer/components/ReaderApp.tsx
    Module not found: Error: Can't resolve 'ta-json' in '/Users/quentinvalmori/Sites/edrlab/readium-desktop/src/renderer/components'
     @ ./src/renderer/components/ReaderApp.tsx 51:18-36
     @ ./src/index_reader.ts

    ERROR in [at-loader] ./src/renderer/components/ReaderApp.tsx:66:32
        TS2307: Cannot find module 'ta-json'.
MacBook-Pro-de-Quentinreadium-desktop>
$npm --version
5.6.0
$node --version
v8.11.2

If I remove the package-lock.json, I can run rm -rf node_modules && (npm ci || npm install) && npm run __postinstall && npm run start && npm run start:dev but I can't import a file

@danielweck
Copy link
Member

Have you tried the feature/npm-update-packs branch?

@Crash--
Copy link
Author

Crash-- commented Jul 13, 2018

Oh, it works on feature/npm-update-packs branch! 👍

@leomoty
Copy link

leomoty commented Aug 14, 2018

leo@leo-VirtualBox:~/readium-desktop$ npm --version
5.6.0
leo@leo-VirtualBox:~/readium-desktop$ node --version
v8.11.3

In both cases I am trying to run:

rm -rf node_modules && (npm ci || npm install) && npm run __postinstall && npm run start && npm run start:dev

Building from master:

Same error as @Crash-- followed by some mismatched types.

    ERROR in ./src/renderer/components/ReaderApp.tsx
    Module not found: Error: Can't resolve 'ta-json' in '/home/leo/readium-desktop/src/renderer/components'
     @ ./src/renderer/components/ReaderApp.tsx 51:18-36
     @ ./src/index_reader.ts
    
    ERROR in [at-loader] ./src/renderer/components/ReaderApp.tsx:66:32 
        TS2307: Cannot find module 'ta-json'.
    
    ERROR in [at-loader] ./src/renderer/components/ReaderApp.tsx:295:33 
        TS2345: Argument of type '(docHref: string, docSelector: string) => void' is not assignable to parameter of type '(docHref: string, locator: IEventPayload_R2_EVENT_READING_LOCATION) => void'.
      Types of parameters 'docSelector' and 'locator' are incompatible.
        Type 'IEventPayload_R2_EVENT_READING_LOCATION' is not assignable to type 'string'.
    
    ERROR in [at-loader] ./src/renderer/components/ReaderApp.tsx:671:13 
        TS2345: Argument of type 'string' is not assignable to parameter of type 'IEventPayload_R2_EVENT_READING_LOCATION'.

Building from feature/npm-update-packs

    ERROR in [at-loader] ./src/renderer/components/ReaderApp.tsx:295:33 
        TS2345: Argument of type '(docHref: string, docSelector: string) => void' is not assignable to parameter of type '(docHref: string, locator: IEventPayload_R2_EVENT_READING_LOCATION) => void'.
      Types of parameters 'docSelector' and 'locator' are incompatible.
        Type 'IEventPayload_R2_EVENT_READING_LOCATION' is not assignable to type 'string'.
    
    ERROR in [at-loader] ./src/renderer/components/ReaderApp.tsx:671:13 
        TS2345: Argument of type 'string' is not assignable to parameter of type 'IEventPayload_R2_EVENT_READING_LOCATION'.

Which is the same type mismatch, is this a new problem?

@danielweck
Copy link
Member

@leomoty regarding feature/npm-update-packs let's discuss in the PR: #161

@danielweck danielweck mentioned this issue Aug 14, 2018
@danielweck
Copy link
Member

Regarding the "mismatched types" in master or develop I suspect that NPM version 5.6.0 is messing up the package-lock.json / node_modules dependencies. There is no reason why the latest r2-xxx-js packages (which contain a breaking change) should be pulled-in, because the NPM lockfile explicitly freezes the correct Git revision. The whole point of package-lock.json is to have reproducible, reliable builds ... but unfortunately NPM is not bug-free. I will try on Windows 10 to see if I can reproduce the issue.

@danielweck
Copy link
Member

Personally on Windows 10 I stick to NPM 5.x as I experienced problems with 6.x. This is version 5.10.x to be precise, and I use npm ci for all my Windows tests (I use npm install on my MacOS development machine where the node_modules dependency tree is likely to change). On all my computers I use NodeJS 8.x (latest LTS), not version 10.x with which I had issues in the past. On MacOS and Linux I use NPM 6.x without any issues.

@waharnum
Copy link

waharnum commented Aug 14, 2018

Briefly reporting in that I had the "mismatched types" issue as well using npm install on the feature/npm-update-packs branch, including with NPM 6.3.0. I wasn't even able to see the desktop interface start in my case, and I can see that after running npm install && npm run __postinstall that package-lock.json has been modified.

npm ci && npm run __postinstall, on the other hand, seem to work without error, don't modify package-lock.json, and result in me being able to run the desktop interface with npm run start or npm run start:dev, import books I've downloaded and read them.

I just confirmed that starting from fresh via rm -rf node_modules or even a completely fresh checkout , npm install always fails for me in the same way, and npm ci succeeds.

Reading about npm ci briefly at https://docs.npmjs.com/cli/ci, I wouldn't expect from the second bullet point that package-lock.json would be modified by npm install unless dependencies aren't matching between package.json and package-lock.json, but in that case it implies npm ci will exit with an error - that didn't occur here.

I hope the above might be of some help in providing additional information (this issue and the PR at #161 gave me the pointers I needed to run readium-desktop locally with the use of npm ci).

System details:

  • MacOS 10.13.6
  • Node 8.11.3
  • NPM 6.3.0

@danielweck
Copy link
Member

Thanks @waharnum
Interesting, as I am on MacOS as well (albeit 10.11.6) and NodeJS 8.11.3 + NPM 6.3.0 too. I use npm install (not npm ci) because as a developer I regularly need to update the package-lock.json / node_modules tree of dependencies ... yet I have no problems at all! Weird.

@waharnum
Copy link

@danielweck Vagaries of NPM or other environmental differences I guess - there's a lot of other things that could be going on. I'll see if I can try this on other environments I have access to (I have a separate MacOS laptop as well as my work desktop) to see if there's any consistency.

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

6 participants