1

I have an ICM profile that I wish to import into a certain file. I need this because I need to fetch the contents of the file into a Uint8Array (array buffer). However, I can't get the file to import.

I've tried

import file from './tester.icm';
import { file } from './tester.icm';
const file = require('./tester.icm');

I would expect it to work like importing an image:

import logo from './logo.png';

However, this approach does not work.

This is a new question since it deals with a binary format, not a simple text file.

Some Guy
  • 351
  • 1
  • 4
  • 20
  • Possible duplicate of [How to import a .txt file from my source?](https://stackoverflow.com/questions/50539756/how-to-import-a-txt-file-from-my-source) – AdityaSrivast Jun 24 '19 at 13:14
  • @AdityaSrivast I looked at that post, but it did not solve my problem. They are dealing with text files with which that can reformat the text they wanted to import into a JSON, which I cannot do. – Some Guy Jun 24 '19 at 13:37

1 Answers1

0

The import statement that you are using is done by Webpack and not by React. Webpack can not import all file types by default, for some file types you will need to configure your own loader. You can have a look at the docs for more information.

cubefox
  • 1,251
  • 14
  • 29