1

I tried to import model.task file in App.tsx file, but it shows some errors.

I trained hand gesture recognition model and exported it to model.task file using Python. And I'm going to import it in App.tsx which is Next.js + Typescript project.

import Model from '@/utils/models/model.task';

But I'm getting an error below.

Module parse failed: Unexpected character '' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file)

How to I resolve this issue? Please help me with that.

2 Answers 2

0

I think you've to declare .task in your webpack config

Something like this

// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.task$/,
        use: 'file-loader',
      },
    ],
  },
};

Take from https://v4.webpack.js.org/loaders/file-loader/

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your response. But I'm using Typescript and the problem was occured from App.tsx file.
0

Just save the .task file inside public

And const filename= "/{filename).task"

You can't import any file directly(I don't think .task file have any export module)

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.