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.

Unable to import local files

See original GitHub issue

This is a Bug Report

Description

When I import my local files I have to specify the file extension otherwise webpack throws an error

import { Student } from "./student.ts"; Works fine 👍

import { Student } from "./student"; Throws error: ERROR in ./handler.ts Module not found: Error: Can't resolve './student' in '/Users/edwardbyrne/Desktop/my-service' @ ./handler.ts 3:16-36

Very strange!

Additional Data


webpack.config.js
const path = require('path');
// eslint-disable-next-line import/no-unresolved
const slsw = require('serverless-webpack');

module.exports = {
  entry: slsw.lib.entries,
  output: {
    libraryTarget: 'commonjs',
    path: path.join(__dirname, '.webpack'),
    filename: '[name].js',
  },
  target: 'node',
  module: {
    loaders: [
      { test: /\.ts(x?)$/, loader: 'ts-loader' },
    ],
  },
};

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

0reactions
HyperBraincommented, Sep 18, 2017

Merged 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Can't import local files - The Spotify Community
You can still add local files to Spotify. Go into the settings and under "Local Files" you can import the source folder that...
Read more >
import local files fails while import() succeeds #570 - GitHub
I am trying to load a local file for side effects, however it seems that when using an import statement over an import...
Read more >
Unable to import zip file - Support - Local Community
Hello, I have got an issue with importing a zip file containing a finished website. The error I'm getting is this. “Uh-oh! Unable...
Read more >
Import local file not resolved - typescript - Stack Overflow
looks like you are importing a CSS file and that file(app.css) does not exist. if you are planning to use App.tsx file, you...
Read more >
Unable to import local files to itunes library : r/AppleMusic
Every time I try to upload local files to my itunes library, it will either A. show that i'm logged in, but won't...
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