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

After upgrade to 1.1.0, the module cannot be imported #17

Closed
gcampax opened this issue Apr 11, 2019 · 7 comments
Closed

After upgrade to 1.1.0, the module cannot be imported #17

gcampax opened this issue Apr 11, 2019 · 7 comments

Comments

@gcampax
Copy link
Contributor

gcampax commented Apr 11, 2019

It looks like the current version of package.json no longer has a "main" field (it got lost in 29070c9), and that means that the package will fail to import:

> require('mmap-io')
{ Error: Cannot find module 'mmap-io'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18) code: 'MODULE_NOT_FOUND' }
@erluko
Copy link

erluko commented Apr 27, 2019

In addition to fixing the main field in package.json, I had to edit mmap-io.js since it refers to a nonexistent es-release directory. Changing this to Release allowed the import to succeed on my system.

@LiamKarlMitchell
Copy link

In package.json replace all "es-release" with "Release".
In nmap-io.js replace "es-release" with "Release".
In tsconfig.json replace "es-release" with "Release".
In package.json add "main": "mmap-io.js"

@ozra ozra closed this as completed in 28fad80 Jul 9, 2019
@ozra
Copy link
Owner

ozra commented Jul 9, 2019

Sorry I didn't see the github notifications earlier, fixed and updated. Holler and tag me if you have any problems!

@gcampax
Copy link
Contributor Author

gcampax commented Jul 9, 2019

Sorry, this is not fixed yet. The build artifact live in build/Release because you use node-gyp (as you should), but mmap-io.js imports build/es-release/mmap-io.
See an example of build failure: https://travis-ci.com/stanford-oval/genie-toolkit/builds/118448865 (from greenkeeper trying the new build on my project)

@gcampax
Copy link
Contributor Author

gcampax commented Jul 9, 2019

(tagging @ozra as requested)

@ozra
Copy link
Owner

ozra commented Jul 9, 2019

Alright, I'll go over it again, I'll dig up some of my old Quant-projects that use it heavily, and see how it behaves and get it right.

@ozra ozra reopened this Jul 9, 2019
@ozra
Copy link
Owner

ozra commented Jul 10, 2019

So...

  1. the es-release files where black-listed and therefor not packaged into the npm
  2. when they got with, they where wiped out on installment when the binary was rebuilt
  • turns out just getting rid of the Makefile caused more crap than I ever had imagined, this actually took longer to get straight than rewriting the horror-show V8-code [ed: because they break compatibility every few months ] xD

Anyway, the js-files are now built into "dist" instead, and the binary into "build" as before, to keep them separated and thereby allow them to be built pre-publish and avoid unnecessary dependencies for the end-user, as intended.

Well. Should shit still roar up — just tag and shout out. Your project seems really cool by the way! I've bookmarked it along with a trail of others I found from it. For "when there is time" xD

Cheers!

@ozra ozra closed this as completed Jul 10, 2019
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

4 participants