Initially I thought npm link went funny, but I have no more linked modules due to removing all the global node modules. I also removed digital-paper-edit-client in case a softlink file was surviving.
Additional Info
What I see in A:
$ webpack --config webpack.config.js
Hash: 3a8a1e677f226afb9df5
Version: webpack 4.40.2
Time: 505ms
Built at: 19/09/2019 14:24:01
18 assets
Entrypoint Breadcrumb = Breadcrumb.js Breadcrumb.js.map
Entrypoint CustomAlert = CustomAlert.js CustomAlert.js.map
Entrypoint FormModal = FormModal.js FormModal.js.map
Entrypoint ItemForm = ItemForm.js ItemForm.js.map
Entrypoint List = List.js List.js.map
Entrypoint SearchBar = SearchBar.js SearchBar.js.map
Entrypoint PreviewCanvas = PreviewCanvas.js PreviewCanvas.js.map
Entrypoint ProgrammeScriptContainer = ProgrammeScriptContainer.js ProgrammeScriptContainer.js.map
Entrypoint SimpleCard = SimpleCard.js SimpleCard.js.map
9 modules
ERROR in ./packages/components/Breadcrumb/index.js 11:8
Module parse failed: Unexpected token (11:8)
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
| if (item.link) {
| return (
> <LinkContainer key={ item.name } to={ item.link }>
| <Breadcrumb.Item>{item.name}</Breadcrumb.Item>
| </LinkContainer>
ERROR in ./packages/components/FormModal/index.js 12:47
Module parse failed: Unexpected token (12:47)
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
| const [ showModal, toggleShowModal ] = useState(props.showModal);
|
> const form = (props.type === 'transcript') ? <TranscriptForm { ...props }/> : <ItemForm { ...props }/>;
|
| return (
ERROR in ./packages/components/CustomAlert/index.js 14:27
Module parse failed: Unexpected token (14:27)
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
|
| const setAlertHeading = () => {
> return props.heading ? <Alert.Heading>{props.heading}</Alert.Heading> : null;
| };
|
ERROR in ./packages/components/ProgrammeScriptContainer/index.js 17:4
Module parse failed: Unexpected token (17:4)
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
|
| const SortableList = SortableContainer(({ children }) =>
> <ul style={ { listStyle: 'none', padding: '0px' } }>
| {children}
| </ul>
ERROR in ./packages/components/List/SearchBar/index.js 22:4
Module parse failed: Unexpected token (22:4)
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
|
| return (
> <InputGroup className="mb-3">
| <InputGroup.Prepend
| onClick={ () => setToggleShowInput(!toggleSearchInput) }
ERROR in ./packages/components/ItemForm/index.js 34:4
Module parse failed: Unexpected token (34:4)
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
| return (
|
> <Form noValidate
| validated={ isValidated }
| onSubmit={ handleSubmit }
ERROR in ./packages/components/SimpleCard/index.js 35:4
Module parse failed: Unexpected token (35:4)
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
|
| return (
> <Card style={ { width: '100%', marginBottom: '1em' } }>
| <Card.Body>
| <Row>
ERROR in ./packages/components/List/index.js 44:8
Module parse failed: Unexpected token (44:8)
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
| if (item.display && item.status) {
| return (
> <TranscriptCard
| { ...item }
| handleEdit={ props.handleEdit(item.id) }
ERROR in ./packages/components/PreviewCanvas/index.js 9:4
Module parse failed: Unexpected token (9:4)
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
|
| return (
> <VideoContextPreview
| canvasRef={ canvasRef }
| playlist={ props.playlist }
error Command failed with exit code 2.
Cannot build
npm run build:component
from webpack-npm-publish:Context
I can’t build in my original repo using webpack BUT if I
cp -R repo new-repo
and run the same exact command it works… which means the error its outputting (see bottom) is nonsense. Webpack is invoked from the project directory. Here is the command I run: https://github.com/bbc/digital-paper-edit-storybook/blob/4b560deb5559126f1cd8ad79465cfa7cdd617345/package.json#L9From here on I'll describe the original repository as "A". The same repository with a different name will be described "B".
Working scenarios
npm link
? (assumption)Not working scenarios
Things I've done
rm -rf node_modules && rm -f package-lock.json
a million timesInitially I thought npm link went funny, but I have no more linked modules due to removing all the global node modules. I also removed
digital-paper-edit-client
in case a softlink file was surviving.Additional Info
What I see in A:
What I see in B: