question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot get extract-files implementation to work?

See original GitHub issue

Describe the bug

extract-files won’t import now that I’m using v3.

Expected behavior

import { extractFiles } from 'extract-files'

const CreateApolloLink = (httpLink: HttpLink) => {

  const typenameLink = new ApolloLink((operation, forward) => forward(ModifyOperationVariables(operation)))

  const http = httpLink.create({
    uri: environment.graphql,
    method: 'POST',
    useMultipart: true,
    withCredentials: true,
    extractFiles
  })

  return ApolloLink.from([typenameLink, http])
}
Error: Module not found: Error: Package path . is not exported from package C:\outbuild\clientv1\node_modules\extract-files (see exports field in C:\outbuild\clientv1\node_modules\extract-files\package.json)

Is anyone else getting this issue trying to import extractFiles? I’m guessing this has been working for people.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
GabrielGilcommented, Apr 13, 2022

The extract-files function works fine v12. As indicated, simply indicate a compatible function.

// 1. Import extractFiles function, and isExtractableFile, which is needed as a second argument of the function.

// Need to ignore the import, because there are no module types, and the ones from @types/extract-files are for v11 yet.
// @ts-ignore
import extractFiles from 'extract-files/extractFiles.mjs';
// @ts-ignore
import isExtractableFile from 'extract-files/isExtractableFile.mjs';

// 2. Set httpLink with an anonymous function to adapt extract-files
httpLink.create({ uri:'yoururl', extractFiles: (body) => extractFiles(body, isExtractableFile) })
2reactions
RyannGaleacommented, Feb 18, 2022

Ok, only works for me when using

Works:

    "extract-files": "11.0.0",

Not working:

    "extract-files": "12.0.0",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not compile with typescript, module resolution failed with ...
Hi There was an issue with this lately but it was resolved in CRA webpack config. As that config can read and understand...
Read more >
extract files from msi and published dll - MSDN - Microsoft
hi my friend accidently deleted my project files. 1. can i extract vb files from msi or exe files ? if can how...
Read more >
How to extract files from a procedure library
1) Use prolib -list command to list the contents of the library. 2) From the output, identify file/directory structure - files will be...
Read more >
How do I extract files from an MSI package? - Super User
First, to access a command prompt, do this: Click the Start button. Click All Programs. Go into Accessories. Left-click on Command Prompt.
Read more >
how to extract files from a 7-zip stream in Java without store it ...
1. tips:the 7-zip byte stream is a socket stream(or http request stream),not a file stored on disk,we can't even use File class. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found