Git Product home page Git Product logo

Comments (25)

niftylettuce avatar niftylettuce commented on May 27, 2024 2

I'm attempting to reproduce again, will follow up shortly.

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024 1

Closing for now, I am almost positive it was an issue, but maybe just mismatch versions or some weird things happening, I don't want to keep this open if I can't dedicate time to resolving.

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024 1

Thanks for debugging this, @niftylettuce! That helped. I added a better error message to explain what I said earlier: #14 (comment), and linked vfile in the docs.

The previous change was in a major release. Also to clarify: you are not forced to use to-vfile, but you must define a path on the file, which to-vfile does for you. you can also pass it yourself:

var fp = 'path/to/file.md'

// ...

.process({contents: fs.readFileSync(fp), path: fp})

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

dirname is a getter/setter. Unfortunately Node does not print it, or the other path-related getter/setters.

The exception is thrown because this plugin assumes that the file you’re processing has path information. It needs this to figure out in which repo the file is. The solution would be to make sure that the file has a path pointing to where it is or should be on the file system. Can you share how you’re running the unified pipeline?

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

Yeah, see https://github.com/ladjs/lad.sh/blob/master/package.json#L211-L215. The fix we temporarily did was to lock the version of this package, and bump a new version of remark-preset-github. Version 1.0.1 here https://github.com/ladjs/lad.sh/blob/master/package.json#L181 is working, however if you yarn add -D [email protected] and run node_modules/.bin/gulp markdown in that repo it would error again.

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

I can’t get that project working. For some reason reddis is needed.

Did you see my note about the solution?

The solution would be to make sure that the file has a path pointing to where it is or should be on the file system.

As a path is missing, it could be that gulp is not passing that correctly. Vinyl hasn’t updated, so when configured correctly, the vinyl file’s path should still be passed to vfile, and thus unified.

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

@wooorm yeah, redis is needed for sessions on the project and in the build process we use mandarin which translates and stores in redis pre-translated strings to save on costs (every query to Google Translate API costs money, it's crazy)

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

fwiw I am able to do gulp remark with your yarn install. gulp markdown does not include remark?

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

Did you rm -rf node_modules yarn.lock, change package remark-preset-github in package.json to v1.0.0 and then re-run yarn and yarn test?

If so you will get the error, it's easily reproducible. Lmk if you still can't reproduce.

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

I can’t run those things because of reddis. I appreciate you but I’m sorry, I think it’s a bit much to ask me to look at your project and figure out how to run it in my free time! I can only help with the projects I maintain, maybe a little bit more, but my earlier example explained what’s needed

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

@niftylettuce Did you get any further with this?

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

Oehh, take it easy, take your time!

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

This happened again to me today. Using latest versions of everything.

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

This was on a clean deployment to a clean server with no caches or anything previously being there.

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

codebase at https://github.com/forwardemail/forwardemail.net

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

That sucks. I still can’t reproduce this though so this exception is not actionable to me

from remark-contributors.

wooorm avatar wooorm commented on May 27, 2024

This is still something I can’t reproduce, and while this error surfaces here, it most likely has to do with another project 🤷‍♂️

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

Ok so I easily reproduced this again. It should probably be re-opened.

  1. Clone this repo https://github.com/forwardemail/forwardemail.net
  2. Update all deps related to remark
  3. Run yarn to install and yarn test to run test
  4. Error occurs (see below, I added a console.log to see what file looked like):
[build] file VFile {
[build]   data: {},
[build]   messages: [],
[build]   history: [],
[build]   cwd: '/Users/user/Projects/forwardemail.net',
[build]   contents: <Buffer 23 20 41 62 6f 75 74 20 46 6f 72 77 61 72 64 20 45 6d 61 69 6c 0a 0a 0a 23 23 20 54 61 62 6c 65 20 6f 66 20 43 6f 6e 74 65 6e 74 73 0a 0a 2a 20 5b 46 ... 9858 more bytes>
[build] }
[build] [19:04:09] 'markdown' errored after 8.13 s
[build] [19:04:09] TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
[build]     at validateString (internal/validators.js:120:11)
[build]     at Object.resolve (path.js:980:7)
[build]     at transform (/Users/user/Projects/forwardemail.net/node_modules/remark-contributors/index.js:27:39)
[build]     at wrapped (/Users/user/Projects/forwardemail.net/node_modules/trough/wrap.js:25:19)
[build]     at next (/Users/user/Projects/forwardemail.net/node_modules/trough/index.js:57:24)
[build]     at done (/Users/user/Projects/forwardemail.net/node_modules/trough/wrap.js:55:16)
[build]     at then (/Users/user/Projects/forwardemail.net/node_modules/trough/wrap.js:62:5)
[build]     at wrapped (/Users/user/Projects/forwardemail.net/node_modules/trough/wrap.js:45:9)
[build]     at next (/Users/user/Projects/forwardemail.net/node_modules/trough/index.js:57:24)
[build]     at done (/Users/user/Projects/forwardemail.net/node_modules/trough/wrap.js:55:16)
[build]     at done (/Users/user/Projects/forwardemail.net/node_modules/unified-lint-rule/index.js:57:9)
[build]     at /Users/user/Projects/forwardemail.net/node_modules/wrapped/index.js:82:42
[build]     at wrap (/Users/user/Projects/forwardemail.net/node_modules/wrapped/index.js:54:27)
[build]     at transformer (/Users/user/Projects/forwardemail.net/node_modules/unified-lint-rule/index.js:34:7)
[build]     at wrapped (/Users/user/Projects/forwardemail.net/node_modules/trough/wrap.js:25:19)
[build]     at next (/Users/user/Projects/forwardemail.net/node_modules/trough/index.js:57:24)

from remark-contributors.

ChristianMurphy avatar ChristianMurphy commented on May 27, 2024

@niftylettuce has the blocker from #14 (comment) been resolved?

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

Yes, I was able to reproduce it on a clean machine

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

I'm going to spend a bit more time here and will follow up if I find more debug information.

from remark-contributors.

ChristianMurphy avatar ChristianMurphy commented on May 27, 2024

That doesn't answer the question.
Redis was previously a blocker for testing, is it still required?


More broadly, the way things are now, this issue could be paraphrased as:

there's a bug in my project, it might or might not have to do with this plugin. Please download my project, do all the dependency upgrades for me, and test it for me, and fix any problems you find.

this is open source, not private support. 😅
If you can narrow the issue to a minimal reproducible example, or even better a failing test case, I'm happy to help.
But in this issue's current state, it's hard to.

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

Definitely will do

from remark-contributors.

niftylettuce avatar niftylettuce commented on May 27, 2024

OK figured out the bug. It was a bug in mandarin, specifically because to-vfile is now required instead of using fs.read to read a file for piping through remark-contributors.

Here is the change that fixes it: ladjs/mandarin@8a09932#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R115

I believe this to be a breaking change though, as in previous versions you could use fs.readFile just fine (without having to be forced to use to-vfile to get it to work).

Not sure if you either want to document this or write a fix? Def seems like a bug though!

Thanks as always!

from remark-contributors.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.