linaria icon indicating copy to clipboard operation
linaria copied to clipboard

_interopRequireDefault is not a function

Open SidneyLann opened this issue 3 years ago • 1 comments
trafficstars

  • Linaria version: 3.0.0-beta.1~17
  • Bundler (+ version): webpack4.46.0
  • Node.js version: 13
  • OS: win7

Description

Module build failed (from ./node_modules/[email protected]@linaria/lib/webpack4-loader.js): NonErrorEmittedError: (Emitted value instead of an instance of Error) TypeError: D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\src\componen t\MessageAlert.tsx: _interopRequireDefault is not a function at D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@webpack\lib\NormalModule.js:313:13 at D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@loader-runner\lib\LoaderRunner.js:367:11 at D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@loader-runner\lib\LoaderRunner.js:233:18 at runSyncOrAsync (D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@loader-runner\lib\LoaderRunner.js:14 3:3) at iterateNormalLoaders (D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@loader-runner\lib\LoaderRunner .js:232:2) at Array. (D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@loader-runner\lib\LoaderRunner.js :205:4) at Storage.finished (D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@enhanced-resolve\lib\CachedInpu tFileSystem.js:55:16) at D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@enhanced-resolve\lib\CachedInputFileSystem.js:91: 9 at D:\DEV\git\repo_eb\pcng-client-taro-repo\pcng-client-taro\pcng-client-taro\[email protected]@graceful-fs\graceful-fs.js:123:16 at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) @ ./src/layout/HeadLayout.tsx 15:0-54 66:32-44

SidneyLann avatar Jan 13 '22 02:01 SidneyLann

import pxNormalize from "./pxNormalize";

width: ${pxNormalize(200)}px;

var _pxNormalize = _interopRequireDefault(require("./pxNormalize"));

TypeError: _interopRequireDefault is not a function It may happen when your code or third party module is invalid or uses identifiers not available in Node environment, eg. window. Note that line numbers in above stack trace will most likely not match, because Linaria needed to transform your code a bit.

fix: linaria3

zhaoxu-lingoace avatar Mar 24 '22 06:03 zhaoxu-lingoace

The issue does not have reproducible case on Stackblitz or Github and will be closed.

v5 has been released recently and fixes a lot of bugs, please bump to it and report a new issue if the problem still exists.

layershifter avatar Sep 24 '23 20:09 layershifter