Unable to import local files
See original GitHub issueThis 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:
- Created 6 years ago
- Comments:11 (10 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@HyperBrain https://github.com/serverless/serverless/pull/4281
Merged 😄